mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
Prototype manifest command.
Output a manifest in text or JSON format. Neither format is complete but they cover the basics. In particular the manifest command outputs the complete block restore when the filter option is specified and the block delta when the pg option is also specified. This is non-destructive so it is safe to execute against a running cluster.
This commit is contained in:
parent
c30d3e439b
commit
505a639f1e
@ -76,6 +76,7 @@ SRCS = \
|
||||
command/control/start.c \
|
||||
command/control/stop.c \
|
||||
command/local/local.c \
|
||||
command/manifest/manifest.c \
|
||||
command/repo/common.c \
|
||||
command/repo/create.c \
|
||||
command/repo/get.c \
|
||||
|
@ -86,6 +86,13 @@ command:
|
||||
log-file: false
|
||||
log-level-default: DEBUG
|
||||
|
||||
manifest:
|
||||
command-role:
|
||||
remote: {}
|
||||
internal: true
|
||||
log-file: false
|
||||
log-level-default: DEBUG
|
||||
|
||||
repo-create:
|
||||
command-role:
|
||||
remote: {}
|
||||
@ -313,6 +320,7 @@ option:
|
||||
command:
|
||||
info: {}
|
||||
repo-ls: {}
|
||||
manifest: {}
|
||||
verify:
|
||||
default: none
|
||||
allow-list:
|
||||
@ -334,6 +342,9 @@ option:
|
||||
info:
|
||||
depend:
|
||||
option: stanza
|
||||
manifest:
|
||||
default: latest
|
||||
required: true
|
||||
restore:
|
||||
default: latest
|
||||
required: true
|
||||
@ -353,6 +364,7 @@ option:
|
||||
expire: {}
|
||||
info:
|
||||
required: false
|
||||
manifest: {}
|
||||
repo-create:
|
||||
required: false
|
||||
repo-get:
|
||||
@ -553,6 +565,7 @@ option:
|
||||
type: string
|
||||
required: false
|
||||
command:
|
||||
manifest: {}
|
||||
repo-ls: {}
|
||||
command-role:
|
||||
main: {}
|
||||
@ -1335,6 +1348,9 @@ option:
|
||||
backup:
|
||||
command-role:
|
||||
local: {}
|
||||
manifest:
|
||||
command-role:
|
||||
main: {}
|
||||
|
||||
pg-database:
|
||||
section: stanza
|
||||
@ -1363,6 +1379,7 @@ option:
|
||||
internal: true
|
||||
backup: {}
|
||||
check: {}
|
||||
manifest: {}
|
||||
restore:
|
||||
internal: true
|
||||
stanza-create: {}
|
||||
@ -1424,6 +1441,7 @@ option:
|
||||
command:
|
||||
backup: {}
|
||||
check: {}
|
||||
manifest: {}
|
||||
stanza-create: {}
|
||||
stanza-delete: {}
|
||||
stanza-upgrade: {}
|
||||
@ -1503,6 +1521,8 @@ option:
|
||||
required: false
|
||||
backup: {}
|
||||
check: {}
|
||||
manifest:
|
||||
required: false
|
||||
restore: {}
|
||||
stanza-create: {}
|
||||
stanza-delete: {}
|
||||
@ -1558,6 +1578,7 @@ option:
|
||||
archive-push: {}
|
||||
backup: {}
|
||||
check: {}
|
||||
manifest: {}
|
||||
restore: {}
|
||||
stanza-create: {}
|
||||
stanza-delete: {}
|
||||
@ -1598,6 +1619,10 @@ option:
|
||||
command-role:
|
||||
main: {}
|
||||
remote: {}
|
||||
manifest:
|
||||
command-role:
|
||||
main: {}
|
||||
remote: {}
|
||||
repo-create:
|
||||
command-role:
|
||||
main: {}
|
||||
@ -1659,6 +1684,7 @@ option:
|
||||
expire:
|
||||
internal: true
|
||||
info: {}
|
||||
manifest: {}
|
||||
repo-create: {}
|
||||
repo-get: {}
|
||||
repo-ls: {}
|
||||
@ -1717,6 +1743,9 @@ option:
|
||||
command-role:
|
||||
main: {}
|
||||
remote: {}
|
||||
manifest:
|
||||
command-role:
|
||||
main: {}
|
||||
repo-create:
|
||||
command-role:
|
||||
main: {}
|
||||
@ -2048,6 +2077,7 @@ option:
|
||||
archive-push: {}
|
||||
check: {}
|
||||
info: {}
|
||||
manifest: {}
|
||||
repo-create: {}
|
||||
repo-get: {}
|
||||
repo-ls: {}
|
||||
|
@ -2023,6 +2023,61 @@
|
||||
</option-list>
|
||||
</command>
|
||||
|
||||
<command id="manifest" name="Query Manifest">
|
||||
<summary>Query manifest.</summary>
|
||||
|
||||
<text>
|
||||
<p>Get information from a manifest including the restore strategy.</p>
|
||||
</text>
|
||||
|
||||
<option-list>
|
||||
<option id="filter" name="Filter Output">
|
||||
<summary>Filter files in output.</summary>
|
||||
|
||||
<text>
|
||||
<p>The filter currently only applies to files and must be specified relative to <id>PGDATA</id>.</p>
|
||||
</text>
|
||||
|
||||
<example>base/13398/16397</example>
|
||||
</option>
|
||||
|
||||
<option id="output" name="Output">
|
||||
<summary>Output format.</summary>
|
||||
|
||||
<text>
|
||||
<p>The following output types are supported:</p>
|
||||
|
||||
<list>
|
||||
<list-item><id>text</id></list-item>
|
||||
<list-item><id>json</id></list-item>
|
||||
</list>
|
||||
</text>
|
||||
|
||||
<example>json</example>
|
||||
</option>
|
||||
|
||||
<option id="pg" name="PostgreSQL Cluster">
|
||||
<summary>PostgreSQL Cluster</summary>
|
||||
|
||||
<text>
|
||||
<p>Specify the PostgreSQL cluster to compare the manifest against.</p>
|
||||
</text>
|
||||
|
||||
<example>1</example>
|
||||
</option>
|
||||
|
||||
<option id="set" name="Set">
|
||||
<summary>Manifest to query.</summary>
|
||||
|
||||
<text>
|
||||
<p>When not specified the latest manifest will be queried.</p>
|
||||
</text>
|
||||
|
||||
<example>20150131-153358F_20150131-153401I</example>
|
||||
</option>
|
||||
</option-list>
|
||||
</command>
|
||||
|
||||
<command id="repo-create" name="Create Repository">
|
||||
<summary>Create the repository.</summary>
|
||||
|
||||
|
540
src/command/manifest/manifest.c
Normal file
540
src/command/manifest/manifest.c
Normal file
@ -0,0 +1,540 @@
|
||||
/***********************************************************************************************************************************
|
||||
Manifest Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command/backup/blockMap.h"
|
||||
#include "command/manifest/manifest.h"
|
||||
#include "command/restore/blockChecksum.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/fdWrite.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/json.h"
|
||||
#include "config/config.h"
|
||||
#include "info/manifest.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Block map render
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct ManifestBlockDeltaReference
|
||||
{
|
||||
unsigned int reference; // Reference
|
||||
List *blockList; // List of blocks in the block map for the reference
|
||||
} ManifestBlockDeltaReference;
|
||||
|
||||
// Reads that must be performed in order to extract blocks
|
||||
typedef struct ManifestBlockDeltaRead
|
||||
{
|
||||
unsigned int reference; // Reference to read from
|
||||
uint64_t bundleId; // Bundle to read from
|
||||
uint64_t offset; // Offset to begin read from
|
||||
uint64_t size; // Size of the read
|
||||
List *superBlockList; // Super block list
|
||||
} ManifestBlockDeltaRead;
|
||||
|
||||
// Super blocks to be extracted from the read
|
||||
typedef struct ManifestBlockDeltaSuperBlock
|
||||
{
|
||||
uint64_t superBlockSize; // Super block size
|
||||
uint64_t size; // Stored super block size (with compression, etc.)
|
||||
List *blockList; // Block list
|
||||
} ManifestBlockDeltaSuperBlock;
|
||||
|
||||
// Blocks to be extracted from the super block
|
||||
typedef struct ManifestBlockDeltaBlock
|
||||
{
|
||||
uint64_t no; // Block number in the super block
|
||||
uint64_t offset; // Offset into original file
|
||||
unsigned char checksum[XX_HASH_SIZE_MAX]; // Checksum of the block
|
||||
} ManifestBlockDeltaBlock;
|
||||
|
||||
FN_EXTERN List *
|
||||
cmdManifestBlockDelta(
|
||||
const BlockMap *const blockMap, const size_t blockSize, const size_t checksumSize, const Buffer *const blockChecksum)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BLOCK_MAP, blockMap);
|
||||
FUNCTION_TEST_PARAM(SIZE, blockSize);
|
||||
FUNCTION_TEST_PARAM(SIZE, checksumSize);
|
||||
FUNCTION_TEST_PARAM(BUFFER, blockChecksum);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(blockMap != NULL);
|
||||
ASSERT(blockSize > 0);
|
||||
|
||||
List *const result = lstNewP(sizeof(ManifestBlockDeltaRead));
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build list of references and for each reference the list of blocks for that reference
|
||||
const unsigned int blockChecksumSize =
|
||||
blockChecksum == NULL ? 0 : (unsigned int)(bufUsed(blockChecksum) / checksumSize);
|
||||
List *const referenceList = lstNewP(sizeof(ManifestBlockDeltaReference), .comparator = lstComparatorUInt);
|
||||
|
||||
for (unsigned int blockMapIdx = 0; blockMapIdx < blockMapSize(blockMap); blockMapIdx++)
|
||||
{
|
||||
const BlockMapItem *const blockMapItem = blockMapGet(blockMap, blockMapIdx);
|
||||
|
||||
// The block must be updated if it is beyond the blocks that exist in the block checksum list or when the checksum
|
||||
// stored in the repository is different from the block checksum list
|
||||
if (blockMapIdx >= blockChecksumSize ||
|
||||
!bufEq(
|
||||
BUF(blockMapItem->checksum, checksumSize),
|
||||
BUF(bufPtrConst(blockChecksum) + blockMapIdx * checksumSize, checksumSize)))
|
||||
{
|
||||
const unsigned int reference = blockMapItem->reference;
|
||||
ManifestBlockDeltaReference *const referenceData = lstFind(referenceList, &reference);
|
||||
|
||||
// If the reference has not been added
|
||||
if (referenceData == NULL)
|
||||
{
|
||||
ManifestBlockDeltaReference *referenceData = lstAdd(
|
||||
referenceList,
|
||||
&(ManifestBlockDeltaReference){.reference = reference, .blockList = lstNewP(sizeof(unsigned int))});
|
||||
lstAdd(referenceData->blockList, &blockMapIdx);
|
||||
}
|
||||
// Else add the new block
|
||||
else
|
||||
lstAdd(referenceData->blockList, &blockMapIdx);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the reference list ascending. This is an arbitrary choice as the order does not matter.
|
||||
lstSort(referenceList, sortOrderAsc);
|
||||
|
||||
// Build delta
|
||||
for (unsigned int referenceIdx = 0; referenceIdx < lstSize(referenceList); referenceIdx++)
|
||||
{
|
||||
const ManifestBlockDeltaReference *const referenceData = (const ManifestBlockDeltaReference *)lstGet(
|
||||
referenceList, referenceIdx);
|
||||
ManifestBlockDeltaRead *blockDeltaRead = NULL;
|
||||
ManifestBlockDeltaSuperBlock *blockDeltaSuperBlock = NULL;
|
||||
const BlockMapItem *blockMapItemPrior = NULL;
|
||||
|
||||
for (unsigned int blockIdx = 0; blockIdx < lstSize(referenceData->blockList); blockIdx++)
|
||||
{
|
||||
const unsigned int blockMapIdx = *(unsigned int *)lstGet(referenceData->blockList, blockIdx);
|
||||
const BlockMapItem *const blockMapItem = blockMapGet(blockMap, blockMapIdx);
|
||||
|
||||
// Add read when it has changed
|
||||
if (blockMapItemPrior == NULL ||
|
||||
(blockMapItemPrior->offset != blockMapItem->offset &&
|
||||
blockMapItemPrior->offset + blockMapItemPrior->size != blockMapItem->offset))
|
||||
{
|
||||
MEM_CONTEXT_OBJ_BEGIN(result)
|
||||
{
|
||||
ManifestBlockDeltaRead blockDeltaReadNew =
|
||||
{
|
||||
.reference = blockMapItem->reference,
|
||||
.bundleId = blockMapItem->bundleId,
|
||||
.offset = blockMapItem->offset,
|
||||
.superBlockList = lstNewP(sizeof(ManifestBlockDeltaSuperBlock)),
|
||||
};
|
||||
|
||||
blockDeltaRead = lstAdd(result, &blockDeltaReadNew);
|
||||
}
|
||||
MEM_CONTEXT_OBJ_END();
|
||||
}
|
||||
|
||||
// Add super block when it has changed
|
||||
if (blockMapItemPrior == NULL || blockMapItemPrior->offset != blockMapItem->offset)
|
||||
{
|
||||
MEM_CONTEXT_OBJ_BEGIN(blockDeltaRead->superBlockList)
|
||||
{
|
||||
ManifestBlockDeltaSuperBlock blockDeltaSuperBlockNew =
|
||||
{
|
||||
.superBlockSize = blockMapItem->superBlockSize,
|
||||
.size = blockMapItem->size,
|
||||
.blockList = lstNewP(sizeof(ManifestBlockDeltaBlock)),
|
||||
};
|
||||
|
||||
blockDeltaSuperBlock = lstAdd(blockDeltaRead->superBlockList, &blockDeltaSuperBlockNew);
|
||||
blockDeltaRead->size += blockMapItem->size;
|
||||
}
|
||||
MEM_CONTEXT_OBJ_END();
|
||||
}
|
||||
|
||||
// Add block
|
||||
ManifestBlockDeltaBlock blockDeltaBlockNew =
|
||||
{
|
||||
.no = blockMapItem->block,
|
||||
.offset = blockMapIdx * blockSize,
|
||||
};
|
||||
|
||||
memcpy(
|
||||
blockDeltaBlockNew.checksum, blockMapItem->checksum, SIZE_OF_STRUCT_MEMBER(ManifestBlockDeltaBlock, checksum));
|
||||
lstAdd(blockDeltaSuperBlock->blockList, &blockDeltaBlockNew);
|
||||
|
||||
// Set prior item for comparison on the next loop
|
||||
blockMapItemPrior = blockMapItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_TEST_RETURN(LIST, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Block map render
|
||||
***********************************************************************************************************************************/
|
||||
static String *
|
||||
cmdManifestBlockDeltaRender(const Manifest *const manifest, const ManifestFile *const file, const bool json)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug);
|
||||
FUNCTION_LOG_PARAM(MANIFEST, manifest);
|
||||
FUNCTION_LOG_PARAM(MANIFEST_FILE, file);
|
||||
FUNCTION_LOG_PARAM(BOOL, json);
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
String *const result = strNew();
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Load block checksums for the file if the pg option is explicitly set
|
||||
const Buffer *blockChecksum = NULL;
|
||||
const Buffer *checksum = NULL;
|
||||
|
||||
if (cfgOptionSource(cfgOptPg) != cfgSourceDefault)
|
||||
{
|
||||
IoRead *const read = storageReadIo(storageNewReadP(storagePg(), manifestPathPg(file->name)));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), cryptoHashNew(hashTypeSha1));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), blockChecksumNew(file->blockIncrSize, file->blockIncrChecksumSize));
|
||||
ioReadDrain(read);
|
||||
|
||||
checksum = pckReadBinP(ioFilterGroupResultP(ioReadFilterGroup(read), CRYPTO_HASH_FILTER_TYPE));
|
||||
blockChecksum = pckReadBinP(ioFilterGroupResultP(ioReadFilterGroup(read), BLOCK_CHECKSUM_FILTER_TYPE));
|
||||
}
|
||||
|
||||
// If the file is up-to-date
|
||||
if (checksum != NULL && bufEq(checksum, BUF(file->checksumSha1, HASH_TYPE_SHA1_SIZE)))
|
||||
{
|
||||
if (json)
|
||||
strCatZ(result, "null");
|
||||
else
|
||||
strCatZ(result, " file is up-to-date\n");
|
||||
}
|
||||
// Else render the block delta
|
||||
else
|
||||
{
|
||||
StorageRead *const read = storageNewReadP(
|
||||
storageRepo(),
|
||||
backupFileRepoPathP(
|
||||
file->reference != NULL ? file->reference : manifestData(manifest)->backupLabel, .manifestName = file->name,
|
||||
.bundleId = file->bundleId, .compressType = manifestData(manifest)->backupOptionCompressType,
|
||||
.blockIncr = true),
|
||||
.offset = file->bundleOffset + file->sizeRepo - file->blockIncrMapSize,
|
||||
.limit = VARUINT64(file->blockIncrMapSize));
|
||||
|
||||
if (manifestCipherSubPass(manifest) != NULL)
|
||||
{
|
||||
ioFilterGroupAdd(
|
||||
ioReadFilterGroup(storageReadIo(read)),
|
||||
cipherBlockNewP(
|
||||
cipherModeDecrypt, cipherTypeAes256Cbc, BUFSTR(manifestCipherSubPass(manifest)), .raw = true));
|
||||
}
|
||||
|
||||
ioReadOpen(storageReadIo(read));
|
||||
|
||||
List *const blockDelta = cmdManifestBlockDelta(
|
||||
blockMapNewRead(storageReadIo(read), file->blockIncrSize, file->blockIncrChecksumSize), file->blockIncrSize,
|
||||
file->blockIncrChecksumSize, blockChecksum);
|
||||
|
||||
unsigned int referenceRead = 0;
|
||||
uint64_t referenceReadSize = 0;
|
||||
unsigned int referenceSuperBlock = 0;
|
||||
uint64_t referenceSuperBlockSize = 0;
|
||||
unsigned int referenceBlock = 0;
|
||||
|
||||
unsigned int totalRead = 0;
|
||||
uint64_t totalReadSize = 0;
|
||||
unsigned int totalSuperBlock = 0;
|
||||
uint64_t totalSuperBlockSize = 0;
|
||||
unsigned int totalBlock = 0;
|
||||
|
||||
bool first = true;
|
||||
|
||||
if (json)
|
||||
strCatChr(result, '[');
|
||||
else
|
||||
strCatChr(result, '\n');
|
||||
|
||||
for (unsigned int readIdx = 0; readIdx < lstSize(blockDelta); readIdx++)
|
||||
{
|
||||
const ManifestBlockDeltaRead *const read = lstGet(blockDelta, readIdx);
|
||||
|
||||
referenceRead++;
|
||||
referenceReadSize += read->size;
|
||||
referenceSuperBlock += lstSize(read->superBlockList);
|
||||
|
||||
for (unsigned int superBlockIdx = 0; superBlockIdx < lstSize(read->superBlockList); superBlockIdx++)
|
||||
{
|
||||
const ManifestBlockDeltaSuperBlock *const superBlock = lstGet(read->superBlockList, superBlockIdx);
|
||||
|
||||
referenceSuperBlockSize += superBlock->superBlockSize;
|
||||
referenceBlock += lstSize(superBlock->blockList);
|
||||
}
|
||||
|
||||
if (readIdx == lstSize(blockDelta) - 1 ||
|
||||
read->reference != ((const ManifestBlockDeltaRead *)lstGet(blockDelta, readIdx + 1))->reference)
|
||||
{
|
||||
if (json)
|
||||
{
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
strCatChr(result, ',');
|
||||
|
||||
strCatFmt(
|
||||
result,
|
||||
"{\"reference\":%u,\"read\":{\"total\":%u,\"size\":%" PRIu64 "},\"superBlock\":{\"total\":%u"
|
||||
",\"size\":%" PRIu64 "},\"block\":{\"total\":%u}}",
|
||||
read->reference, referenceRead, referenceReadSize, referenceSuperBlock, referenceSuperBlockSize,
|
||||
referenceBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
const String *const reference = strSub(
|
||||
backupFileRepoPathP(
|
||||
strLstGet(manifestReferenceList(manifest), read->reference), .manifestName = file->name,
|
||||
.bundleId = read->bundleId,
|
||||
.compressType = manifestData(manifest)->backupOptionCompressType, .blockIncr = true),
|
||||
sizeof(STORAGE_REPO_BACKUP));
|
||||
|
||||
strCatFmt(
|
||||
result, " reference: %s, read: %u/%s, superBlock: %u/%s, block: %u/%s\n",
|
||||
strZ(reference), referenceRead, strZ(strSizeFormat(referenceReadSize)), referenceSuperBlock,
|
||||
strZ(strSizeFormat(referenceSuperBlockSize)), referenceBlock,
|
||||
strZ(strSizeFormat(referenceBlock * file->blockIncrSize)));
|
||||
}
|
||||
|
||||
totalRead += referenceRead;
|
||||
totalReadSize += referenceReadSize;
|
||||
totalSuperBlock += referenceSuperBlock;
|
||||
totalSuperBlockSize += referenceSuperBlockSize;
|
||||
totalBlock += referenceBlock;
|
||||
|
||||
referenceRead = 0;
|
||||
referenceReadSize = 0;
|
||||
referenceSuperBlock = 0;
|
||||
referenceSuperBlockSize = 0;
|
||||
referenceBlock = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (json)
|
||||
strCatChr(result, ']');
|
||||
else
|
||||
{
|
||||
strCatFmt(
|
||||
result, " total read: %u/%s, superBlock: %u/%s, block: %u/%s\n",
|
||||
totalRead, strZ(strSizeFormat(totalReadSize)), totalSuperBlock, strZ(strSizeFormat(totalSuperBlockSize)),
|
||||
totalBlock, strZ(strSizeFormat(totalBlock * file->blockIncrSize)));
|
||||
}
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(STRING, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Manifest file render
|
||||
***********************************************************************************************************************************/
|
||||
static String *
|
||||
cmdManifestFileRender(const Manifest *const manifest, const ManifestFile *const file, const bool blockDelta, const bool json)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelDebug);
|
||||
FUNCTION_LOG_PARAM(MANIFEST, manifest);
|
||||
FUNCTION_LOG_PARAM(MANIFEST_FILE, file);
|
||||
FUNCTION_LOG_PARAM(BOOL, blockDelta);
|
||||
FUNCTION_LOG_PARAM(BOOL, json);
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
String *const result = strNew();
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
if (json)
|
||||
{
|
||||
strCatFmt(result, "{\"name\":%s", strZ(jsonFromVar(VARSTR(file->name))));
|
||||
strCatFmt(result, ",\"size\":%" PRIu64, file->size);
|
||||
strCatFmt(
|
||||
result, ",\"checksum\":\"%s\"", strZ(strNewEncode(encodingHex, BUF(file->checksumSha1, HASH_TYPE_SHA1_SIZE))));
|
||||
strCatFmt(result, ",\"repo\":{\"size\":%" PRIu64 "}", file->sizeRepo);
|
||||
|
||||
if (file->bundleId != 0)
|
||||
strCatFmt(result, ",\"bundle\":{\"id\":%" PRIu64 ",\"offset\":%" PRIu64 "}", file->bundleId, file->bundleOffset);
|
||||
|
||||
if (file->blockIncrSize != 0)
|
||||
{
|
||||
strCatFmt(
|
||||
result, ",\"block\":{\"size\":%zu,\"map\":{\"size\":%" PRIu64, file->blockIncrSize, file->blockIncrMapSize);
|
||||
|
||||
if (blockDelta)
|
||||
strCatFmt(result, ",\"delta\":%s", strZ(cmdManifestBlockDeltaRender(manifest, file, json)));
|
||||
|
||||
strCatFmt(result, "},\"checksum\":{\"size\":%zu}}", file->blockIncrChecksumSize);
|
||||
}
|
||||
|
||||
strCatChr(result, '}');
|
||||
}
|
||||
else
|
||||
{
|
||||
strCatFmt(result, " - %s\n", strZ(file->name));
|
||||
strCatFmt(
|
||||
result, " size: %s, repo %s\n", strZ(strSizeFormat(file->size)), strZ(strSizeFormat(file->sizeRepo)));
|
||||
strCatFmt(result, " checksum: %s\n", strZ(strNewEncode(encodingHex, BUF(file->checksumSha1, HASH_TYPE_SHA1_SIZE))));
|
||||
|
||||
if (file->bundleId != 0)
|
||||
strCatFmt(result, " bundle: %" PRIu64 "\n", file->bundleId);
|
||||
|
||||
if (file->blockIncrSize != 0)
|
||||
{
|
||||
strCatFmt(
|
||||
result, " block: size %s, map size %s, checksum size %s\n",
|
||||
strZ(strSizeFormat(file->blockIncrSize)), strZ(strSizeFormat(file->blockIncrMapSize)),
|
||||
strZ(strSizeFormat(file->blockIncrChecksumSize)));
|
||||
|
||||
if (blockDelta)
|
||||
{
|
||||
strCatZ(result, " block delta:");
|
||||
strCat(result, cmdManifestBlockDeltaRender(manifest, file, json));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(STRING, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Manifest render
|
||||
***********************************************************************************************************************************/
|
||||
static String *
|
||||
cmdManifestRender(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
String *const result = strNew();
|
||||
|
||||
// Set dry run to make sure this command never writes anything
|
||||
storageHelperDryRunInit(true);
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Load backup.info and cipher
|
||||
const InfoBackup *const infoBackup = infoBackupLoadFile(
|
||||
storageRepo(), INFO_BACKUP_PATH_FILE_STR, cfgOptionStrId(cfgOptRepoCipherType),
|
||||
cfgOptionStrNull(cfgOptRepoCipherPass));
|
||||
const String *const cipherPass = infoPgCipherPass(infoBackupPg(infoBackup));
|
||||
const CipherType cipherType = cipherPass == NULL ? cipherTypeNone : cipherTypeAes256Cbc;
|
||||
|
||||
// Load manifest
|
||||
const Manifest *const manifest = manifestLoadFile(
|
||||
storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strZ(cfgOptionStr(cfgOptSet))),
|
||||
cipherType, cipherPass);
|
||||
|
||||
// Manifest info
|
||||
const ManifestData *const data = manifestData(manifest);
|
||||
const bool json = cfgOptionStrId(cfgOptOutput) == CFGOPTVAL_OUTPUT_JSON;
|
||||
|
||||
if (json)
|
||||
{
|
||||
strCatFmt(result, "{\"label\":\"%s\"", strZ(data->backupLabel));
|
||||
strCatFmt(result, ",\"reference\":[%s]", strZ(strLstJoinQuote(manifestReferenceList(manifest), ",", "\"")));
|
||||
strCatFmt(result, ",\"type\":\"%s\"", strZ(strIdToStr(data->backupType)));
|
||||
strCatFmt(
|
||||
result, ",\"time\":{\"start\":%" PRId64 ",\"copy\":%" PRId64 ",\"stop\":%" PRId64 "}",
|
||||
(int64_t)data->backupTimestampStart, (int64_t)data->backupTimestampCopyStart, (int64_t)data->backupTimestampStop);
|
||||
strCatFmt(
|
||||
result, ",\"bundle\":{\"bundle\":%s,\"raw\":%s}", cvtBoolToConstZ(data->bundle), cvtBoolToConstZ(data->bundleRaw));
|
||||
strCatFmt(result, ",\"block\":{\"block\":%s}", cvtBoolToConstZ(data->blockIncr));
|
||||
}
|
||||
else
|
||||
{
|
||||
strCatFmt(result, "label: %s\n", strZ(data->backupLabel));
|
||||
strCatFmt(result, "reference: %s\n", strZ(strLstJoin(manifestReferenceList(manifest), ", ")));
|
||||
strCatFmt(result, "type: %s\n", strZ(strIdToStr(data->backupType)));
|
||||
|
||||
struct tm timePart;
|
||||
char timeBufferStart[20];
|
||||
char timeBufferStop[20];
|
||||
int64_t duration = (int64_t)(data->backupTimestampStop - data->backupTimestampStart);
|
||||
|
||||
strftime(
|
||||
timeBufferStart, sizeof(timeBufferStart), "%Y-%m-%d %H:%M:%S", localtime_r(&data->backupTimestampStart, &timePart));
|
||||
strftime(
|
||||
timeBufferStop, sizeof(timeBufferStop), "%Y-%m-%d %H:%M:%S", localtime_r(&data->backupTimestampStop, &timePart));
|
||||
strCatFmt(
|
||||
result, "time: start: %s, stop: %s, duration: %" PRId64 ":%02" PRId64 ":%02" PRId64 "\n", timeBufferStart,
|
||||
timeBufferStop, duration / 3600, duration % 3600 / 60, duration % 60);
|
||||
|
||||
strCatFmt(result, "bundle: %s\n", cvtBoolToConstZ(data->bundle));
|
||||
strCatFmt(result, "block: %s\n", cvtBoolToConstZ(data->blockIncr));
|
||||
|
||||
strCatChr(result, '\n');
|
||||
}
|
||||
|
||||
// File list
|
||||
if (json)
|
||||
strCatZ(result, ",\"fileList\":[");
|
||||
else
|
||||
strCatZ(result, "file list:\n");
|
||||
|
||||
const String *const filter = cfgOptionStrNull(cfgOptFilter);
|
||||
|
||||
// Single file
|
||||
if (filter != NULL)
|
||||
{
|
||||
const ManifestFile file = manifestFileFind(manifest, strNewFmt(MANIFEST_TARGET_PGDATA "/%s", strZ(filter)));
|
||||
|
||||
strCat(result, cmdManifestFileRender(manifest, &file, true, json));
|
||||
}
|
||||
// Multiple files
|
||||
else
|
||||
{
|
||||
for (unsigned int fileIdx = 0; fileIdx < manifestFileTotal(manifest); fileIdx++)
|
||||
{
|
||||
const ManifestFile file = manifestFile(manifest, fileIdx);
|
||||
|
||||
if (fileIdx != 0)
|
||||
{
|
||||
if (json)
|
||||
strCatChr(result, ',');
|
||||
else
|
||||
strCatChr(result, '\n');
|
||||
}
|
||||
|
||||
strCat(result, cmdManifestFileRender(manifest, &file, false, json));
|
||||
}
|
||||
}
|
||||
|
||||
if (json)
|
||||
strCatZ(result, "]}");
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(STRING, result);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
FN_EXTERN void
|
||||
cmdManifest(void)
|
||||
{
|
||||
FUNCTION_LOG_VOID(logLevelDebug);
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
ioFdWriteOneStr(STDOUT_FILENO, cmdManifestRender());
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
13
src/command/manifest/manifest.h
Normal file
13
src/command/manifest/manifest.h
Normal file
@ -0,0 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Manifest Command
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMAND_MANIFEST_MANIFEST_H
|
||||
#define COMMAND_MANIFEST_MANIFEST_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Manifest info
|
||||
FN_EXTERN void cmdManifest(void);
|
||||
|
||||
#endif
|
@ -17,6 +17,7 @@ Command constants
|
||||
#define CFGCMD_EXPIRE "expire"
|
||||
#define CFGCMD_HELP "help"
|
||||
#define CFGCMD_INFO "info"
|
||||
#define CFGCMD_MANIFEST "manifest"
|
||||
#define CFGCMD_REPO_CREATE "repo-create"
|
||||
#define CFGCMD_REPO_GET "repo-get"
|
||||
#define CFGCMD_REPO_LS "repo-ls"
|
||||
@ -33,7 +34,7 @@ Command constants
|
||||
#define CFGCMD_VERIFY "verify"
|
||||
#define CFGCMD_VERSION "version"
|
||||
|
||||
#define CFG_COMMAND_TOTAL 23
|
||||
#define CFG_COMMAND_TOTAL 24
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Option group constants
|
||||
@ -329,6 +330,7 @@ typedef enum
|
||||
cfgCmdExpire,
|
||||
cfgCmdHelp,
|
||||
cfgCmdInfo,
|
||||
cfgCmdManifest,
|
||||
cfgCmdRepoCreate,
|
||||
cfgCmdRepoGet,
|
||||
cfgCmdRepoLs,
|
||||
|
@ -448,6 +448,19 @@ static const ParseRuleCommand parseRuleCommand[CFG_COMMAND_TOTAL] =
|
||||
), // cmd/info
|
||||
), // cmd/info
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
PARSE_RULE_COMMAND // cmd/manifest
|
||||
( // cmd/manifest
|
||||
PARSE_RULE_COMMAND_NAME("manifest"), // cmd/manifest
|
||||
PARSE_RULE_COMMAND_LOCK_TYPE(lockTypeNone), // cmd/manifest
|
||||
PARSE_RULE_COMMAND_LOG_LEVEL_DEFAULT(logLevelDebug), // cmd/manifest
|
||||
// cmd/manifest
|
||||
PARSE_RULE_COMMAND_ROLE_VALID_LIST // cmd/manifest
|
||||
( // cmd/manifest
|
||||
PARSE_RULE_COMMAND_ROLE(cfgCmdRoleMain) // cmd/manifest
|
||||
PARSE_RULE_COMMAND_ROLE(cfgCmdRoleRemote) // cmd/manifest
|
||||
), // cmd/manifest
|
||||
), // cmd/manifest
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
PARSE_RULE_COMMAND // cmd/repo-create
|
||||
( // cmd/repo-create
|
||||
PARSE_RULE_COMMAND_NAME("repo-create"), // cmd/repo-create
|
||||
@ -1131,6 +1144,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/beta
|
||||
@ -1170,6 +1184,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/beta
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/beta
|
||||
@ -1579,6 +1594,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config
|
||||
@ -1618,6 +1634,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config
|
||||
@ -1658,6 +1675,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config-include-path
|
||||
@ -1697,6 +1715,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config-include-path
|
||||
@ -1737,6 +1756,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config-path
|
||||
@ -1776,6 +1796,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/config-path
|
||||
@ -1984,6 +2005,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/exec-id
|
||||
@ -2023,6 +2045,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/exec-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/exec-id
|
||||
@ -2071,6 +2094,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
// opt/filter
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/filter
|
||||
( // opt/filter
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/filter
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/filter
|
||||
), // opt/filter
|
||||
), // opt/filter
|
||||
@ -2496,6 +2520,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-console
|
||||
@ -2535,6 +2560,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-console
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-console
|
||||
@ -2588,6 +2614,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-file
|
||||
@ -2627,6 +2654,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-file
|
||||
@ -2680,6 +2708,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-stderr
|
||||
@ -2719,6 +2748,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-level-stderr
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-level-stderr
|
||||
@ -2772,6 +2802,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-path
|
||||
@ -2811,6 +2842,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-path
|
||||
@ -2929,6 +2961,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-timestamp
|
||||
@ -2968,6 +3001,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/log-timestamp
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/log-timestamp
|
||||
@ -3138,6 +3172,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/output
|
||||
( // opt/output
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/output
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/output
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/output
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdVerify) // opt/output
|
||||
), // opt/output
|
||||
@ -3188,6 +3223,11 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_REQUIRED(false), // opt/pg
|
||||
PARSE_RULE_OPTION_SECTION(cfgSectionCommandLine), // opt/pg
|
||||
// opt/pg
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/pg
|
||||
( // opt/pg
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg
|
||||
), // opt/pg
|
||||
// opt/pg
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_LOCAL_VALID_LIST // opt/pg
|
||||
( // opt/pg
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg
|
||||
@ -3272,6 +3312,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host
|
||||
@ -3321,6 +3362,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-ca-file
|
||||
@ -3370,6 +3412,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-ca-path
|
||||
@ -3419,6 +3462,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-cert-file
|
||||
@ -3466,6 +3510,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-cmd
|
||||
@ -3502,6 +3547,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-config
|
||||
@ -3543,6 +3589,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-config-include-path
|
||||
@ -3584,6 +3631,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-config-path
|
||||
@ -3627,6 +3675,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-key-file
|
||||
@ -3674,6 +3723,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-port
|
||||
@ -3718,6 +3768,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-type
|
||||
@ -3777,6 +3828,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade) // opt/pg-host-user
|
||||
@ -3821,6 +3873,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-local
|
||||
@ -3869,6 +3922,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-path
|
||||
@ -3895,6 +3949,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-path
|
||||
@ -3908,6 +3963,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_FILTER_CMD // opt/pg-path
|
||||
( // opt/pg-path
|
||||
PARSE_RULE_VAL_CMD(cfgCmdArchivePush), // opt/pg-path
|
||||
PARSE_RULE_VAL_CMD(cfgCmdManifest), // opt/pg-path
|
||||
), // opt/pg-path
|
||||
// opt/pg-path
|
||||
PARSE_RULE_OPTIONAL_NOT_REQUIRED(), // opt/pg-path
|
||||
@ -4076,6 +4132,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-version-force
|
||||
@ -4104,6 +4161,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate) // opt/pg-version-force
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete) // opt/pg-version-force
|
||||
@ -4432,6 +4490,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo
|
||||
@ -4462,6 +4521,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo
|
||||
@ -4507,6 +4567,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-account
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-account
|
||||
@ -4585,6 +4646,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-container
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-container
|
||||
@ -4664,6 +4726,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-endpoint
|
||||
@ -4748,6 +4811,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-key
|
||||
@ -4826,6 +4890,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-key-type
|
||||
@ -4916,6 +4981,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-azure-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-azure-uri-style
|
||||
@ -5318,6 +5384,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-cipher-pass
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-cipher-pass
|
||||
@ -5397,6 +5464,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-cipher-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-cipher-type
|
||||
@ -5481,6 +5549,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-gcs-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-gcs-bucket
|
||||
@ -5558,6 +5627,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-gcs-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-gcs-endpoint
|
||||
@ -5641,6 +5711,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-gcs-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-gcs-key
|
||||
@ -5720,6 +5791,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-gcs-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-gcs-key-type
|
||||
@ -5846,6 +5918,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host
|
||||
@ -5905,6 +5978,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-ca-file
|
||||
@ -5964,6 +6038,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-ca-path
|
||||
@ -6023,6 +6098,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-cert-file
|
||||
@ -6080,6 +6156,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-cmd
|
||||
@ -6135,6 +6212,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-config
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-config
|
||||
@ -6195,6 +6273,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-config-include-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-config-include-path
|
||||
@ -6255,6 +6334,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-config-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-config-path
|
||||
@ -6317,6 +6397,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-key-file
|
||||
@ -6374,6 +6455,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-port
|
||||
@ -6437,6 +6519,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-type
|
||||
@ -6506,6 +6589,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-host-user
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-host-user
|
||||
@ -6569,6 +6653,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-local
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-local
|
||||
@ -6628,6 +6713,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-path
|
||||
@ -6893,6 +6979,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-bucket
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-bucket
|
||||
@ -6972,6 +7059,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-endpoint
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-endpoint
|
||||
@ -7052,6 +7140,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-key
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-key
|
||||
@ -7132,6 +7221,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-key-secret
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-key-secret
|
||||
@ -7210,6 +7300,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-key-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-key-type
|
||||
@ -7301,6 +7392,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-kms-key-id
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-kms-key-id
|
||||
@ -7380,6 +7472,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-region
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-region
|
||||
@ -7458,6 +7551,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-role
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-role
|
||||
@ -7537,6 +7631,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-token
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-token
|
||||
@ -7615,6 +7710,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-s3-uri-style
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-s3-uri-style
|
||||
@ -7705,6 +7801,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-ca-file
|
||||
@ -7785,6 +7882,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-ca-path
|
||||
@ -7865,6 +7963,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-host
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-host
|
||||
@ -7944,6 +8043,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-port
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-port
|
||||
@ -8035,6 +8135,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-upload-chunk-size
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-upload-chunk-size
|
||||
@ -8122,6 +8223,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-storage-verify-tls
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-storage-verify-tls
|
||||
@ -8208,6 +8310,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/repo-type
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/repo-type
|
||||
@ -8472,6 +8575,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdAnnotate) // opt/set
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/set
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/set
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/set
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore) // opt/set
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdVerify) // opt/set
|
||||
), // opt/set
|
||||
@ -8505,6 +8609,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/set
|
||||
PARSE_RULE_FILTER_CMD // opt/set
|
||||
( // opt/set
|
||||
PARSE_RULE_VAL_CMD(cfgCmdManifest), // opt/set
|
||||
PARSE_RULE_VAL_CMD(cfgCmdRestore), // opt/set
|
||||
), // opt/set
|
||||
// opt/set
|
||||
@ -8626,6 +8731,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdExpire) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/stanza
|
||||
@ -8663,6 +8769,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdBackup) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdCheck) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdInfo) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdManifest) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet) // opt/stanza
|
||||
PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs) // opt/stanza
|
||||
|
@ -20,6 +20,7 @@ Main
|
||||
#include "command/help/help.h"
|
||||
#include "command/info/info.h"
|
||||
#include "command/local/local.h"
|
||||
#include "command/manifest/manifest.h"
|
||||
#include "command/remote/remote.h"
|
||||
#include "command/repo/create.h"
|
||||
#include "command/repo/get.h"
|
||||
@ -209,6 +210,12 @@ main(int argListSize, const char *argList[])
|
||||
cmdInfo();
|
||||
break;
|
||||
|
||||
// Manifest command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdManifest:
|
||||
cmdManifest();
|
||||
break;
|
||||
|
||||
// Repository create command
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
case cfgCmdRepoCreate:
|
||||
|
@ -140,6 +140,7 @@ src_pgbackrest = [
|
||||
'command/control/start.c',
|
||||
'command/control/stop.c',
|
||||
'command/local/local.c',
|
||||
'command/manifest/manifest.c',
|
||||
'command/repo/common.c',
|
||||
'command/repo/create.c',
|
||||
'command/repo/get.c',
|
||||
|
@ -856,6 +856,13 @@ unit:
|
||||
- info/infoBackup
|
||||
- info/manifest
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: manifest
|
||||
total: 1
|
||||
|
||||
include:
|
||||
- command/manifest/manifest
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: repo
|
||||
total: 4
|
||||
|
@ -151,7 +151,7 @@ hrnBackupPqScript(const unsigned int pgVersion, const time_t backupTimeStart, Hr
|
||||
HRNPQ_MACRO_STOP_BACKUP_LE_95(1, lsnStopStr, walSegmentStop),
|
||||
|
||||
// Get stop time
|
||||
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 2000),
|
||||
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 52427000),
|
||||
|
||||
HRNPQ_MACRO_DONE()
|
||||
});
|
||||
|
344
test/src/module/command/manifestTest.c
Normal file
344
test/src/module/command/manifestTest.c
Normal file
@ -0,0 +1,344 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Manifest Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "storage/helper.h"
|
||||
|
||||
#include "command/backup/common.h"
|
||||
#include "command/backup/protocol.h"
|
||||
#include "command/stanza/create.h"
|
||||
#include "storage/posix/storage.h"
|
||||
|
||||
#include "common/harnessBackup.h"
|
||||
#include "common/harnessConfig.h"
|
||||
#include "common/harnessPostgres.h"
|
||||
#include "common/harnessProtocol.h"
|
||||
#include "common/harnessStorage.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Test Run
|
||||
***********************************************************************************************************************************/
|
||||
static void
|
||||
testRun(void)
|
||||
{
|
||||
FUNCTION_HARNESS_VOID();
|
||||
|
||||
// Install local command handler shim
|
||||
static const ProtocolServerHandler testLocalHandlerList[] = {PROTOCOL_SERVER_HANDLER_BACKUP_LIST};
|
||||
hrnProtocolLocalShimInstall(testLocalHandlerList, LENGTH_OF(testLocalHandlerList));
|
||||
|
||||
// Test storage
|
||||
const Storage *const storageTest = storagePosixNewP(TEST_PATH_STR, .write = true);
|
||||
|
||||
// Common config
|
||||
HRN_STORAGE_PUT_Z(
|
||||
storageTest, "pgbackrest.conf",
|
||||
"[global]\n"
|
||||
"repo1-path=" TEST_PATH "/repo1\n"
|
||||
"repo1-retention-full=999\n"
|
||||
"repo1-bundle=y\n"
|
||||
"repo1-block=y\n"
|
||||
"repo1-block-size-super-full=32KiB\n"
|
||||
"repo2-path="TEST_PATH "/repo2\n"
|
||||
"repo2-retention-full=999\n"
|
||||
"repo2-cipher-type=aes-256-cbc\n"
|
||||
"repo2-cipher-pass=" TEST_CIPHER_PASS "\n"
|
||||
"repo2-bundle=y\n"
|
||||
"repo2-block=y\n"
|
||||
"\n"
|
||||
"archive-check=n\n"
|
||||
"stop-auto=y\n"
|
||||
"compress-type=none\n"
|
||||
"\n"
|
||||
"[test]\n"
|
||||
"pg1-path=" TEST_PATH "/pg1\n");
|
||||
|
||||
StringList *const argListCommon = strLstNew();
|
||||
hrnCfgArgRawZ(argListCommon, cfgOptStanza, "test");
|
||||
hrnCfgArgRawZ(argListCommon, cfgOptConfig, TEST_PATH "/pgbackrest.conf");
|
||||
|
||||
// Disable most logging
|
||||
harnessLogLevelSet(logLevelWarn);
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("!!!"))
|
||||
{
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("stanza create");
|
||||
{
|
||||
StringList *argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawBool(argList, cfgOptOnline, false);
|
||||
HRN_CFG_LOAD(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control and run stanza-create
|
||||
HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_95, .pageChecksum = false);
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create");
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("full backup with block incr");
|
||||
{
|
||||
const time_t backupTimeStart = BACKUP_EPOCH;
|
||||
|
||||
// Zeroed file large enough to use block incr
|
||||
Buffer *relation = bufNew(8 * 8192);
|
||||
memset(bufPtr(relation), 0, bufSize(relation));
|
||||
bufUsedSet(relation, bufSize(relation));
|
||||
|
||||
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/2", relation, .timeModified = backupTimeStart);
|
||||
|
||||
StringList *argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawStrId(argList, cfgOptType, backupTypeFull);
|
||||
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||
|
||||
// Backup to repo1
|
||||
hrnBackupPqScriptP(PG_VERSION_95, backupTimeStart, .noArchiveCheck = true, .noWal = true);
|
||||
TEST_RESULT_VOID(hrnCmdBackup(), "backup repo1");
|
||||
|
||||
// Backup to repo2
|
||||
hrnCfgArgRawZ(argList, cfgOptRepo, "2");
|
||||
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||
|
||||
hrnBackupPqScriptP(
|
||||
PG_VERSION_95, backupTimeStart, .noArchiveCheck = true, .noWal = true, .cipherType = cipherTypeAes256Cbc,
|
||||
.cipherPass = TEST_CIPHER_PASS);
|
||||
TEST_RESULT_VOID(hrnCmdBackup(), "backup repo2");
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("diff backup with block incr");
|
||||
{
|
||||
const time_t backupTimeStart = BACKUP_EPOCH + 100000;
|
||||
|
||||
// Zeroed file large enough to use block incr
|
||||
Buffer *relation = bufNew(12 * 8192);
|
||||
memset(bufPtr(relation), 0, bufSize(relation));
|
||||
memset(bufPtr(relation) + 2 * 8192, 1, 4 * 8192);
|
||||
bufUsedSet(relation, bufSize(relation));
|
||||
|
||||
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/2", relation, .timeModified = backupTimeStart);
|
||||
|
||||
StringList *argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawStrId(argList, cfgOptType, backupTypeDiff);
|
||||
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||
|
||||
// Backup to repo1
|
||||
hrnBackupPqScriptP(PG_VERSION_95, backupTimeStart, .noArchiveCheck = true, .noWal = true);
|
||||
TEST_RESULT_VOID(hrnCmdBackup(), "backup repo1");
|
||||
|
||||
// Backup to repo2
|
||||
hrnCfgArgRawZ(argList, cfgOptRepo, "2");
|
||||
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||
|
||||
hrnBackupPqScriptP(
|
||||
PG_VERSION_95, backupTimeStart, .noArchiveCheck = true, .noWal = true, .cipherType = cipherTypeAes256Cbc,
|
||||
.cipherPass = TEST_CIPHER_PASS);
|
||||
TEST_RESULT_VOID(hrnCmdBackup(), "backup repo2");
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("manifest block map");
|
||||
{
|
||||
StringList *argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawZ(argList, cfgOptFilter, PG_PATH_BASE "/1/2");
|
||||
hrnCfgArgRawZ(argList, cfgOptSet, "20191002-070640F");
|
||||
HRN_CFG_LOAD(cfgCmdManifest, argList);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
cmdManifestRender(),
|
||||
"label: 20191002-070640F\n"
|
||||
"reference: 20191002-070640F\n"
|
||||
"type: full\n"
|
||||
"time: start: 2019-10-02 07:06:40, stop: 2019-10-02 21:40:27, duration: 14:33:47\n"
|
||||
"bundle: true\n"
|
||||
"block: true\n"
|
||||
"\n"
|
||||
"file list:\n"
|
||||
" - pg_data/base/1/2\n"
|
||||
" size: 64KB, repo 64KB\n"
|
||||
" checksum: 1adc95bebe9eea8c112d40cd04ab7a8d75c4f961\n"
|
||||
" bundle: 1\n"
|
||||
" block: size 8KB, map size 58B, checksum size 6B\n"
|
||||
" block delta:\n"
|
||||
" reference: 20191002-070640F/bundle/1, read: 1/64KB, superBlock: 2/64KB, block: 8/64KB\n"
|
||||
" total read: 1/64KB, superBlock: 2/64KB, block: 8/64KB\n",
|
||||
"repo 1 text");
|
||||
|
||||
hrnCfgArgRawZ(argList, cfgOptOutput, "json");
|
||||
HRN_CFG_LOAD(cfgCmdManifest, argList);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
cmdManifestRender(),
|
||||
// {uncrustify_off - indentation}
|
||||
"{"
|
||||
"\"label\":\"20191002-070640F\","
|
||||
"\"reference\":["
|
||||
"\"20191002-070640F\""
|
||||
"],"
|
||||
"\"type\":\"full\","
|
||||
"\"time\":{"
|
||||
"\"start\":1570000000,"
|
||||
"\"copy\":1570000001,"
|
||||
"\"stop\":1570052427"
|
||||
"},"
|
||||
"\"bundle\":{"
|
||||
"\"bundle\":true,"
|
||||
"\"raw\":true"
|
||||
"},"
|
||||
"\"block\":{"
|
||||
"\"block\":true"
|
||||
"},"
|
||||
"\"fileList\":["
|
||||
"{"
|
||||
"\"name\":\"pg_data/base/1/2\","
|
||||
"\"size\":65536,"
|
||||
"\"checksum\":\"1adc95bebe9eea8c112d40cd04ab7a8d75c4f961\","
|
||||
"\"repo\":{"
|
||||
"\"size\":65610"
|
||||
"},"
|
||||
"\"bundle\":{"
|
||||
"\"id\":1,"
|
||||
"\"offset\":8192"
|
||||
"},"
|
||||
"\"block\":{"
|
||||
"\"size\":8192,"
|
||||
"\"map\":{"
|
||||
"\"size\":58,"
|
||||
"\"delta\":["
|
||||
"{"
|
||||
"\"reference\":0,"
|
||||
"\"read\":{"
|
||||
"\"total\":1,"
|
||||
"\"size\":65552"
|
||||
"},"
|
||||
"\"superBlock\":{"
|
||||
"\"total\":2,"
|
||||
"\"size\":65536"
|
||||
"},"
|
||||
"\"block\":{"
|
||||
"\"total\":8"
|
||||
"}"
|
||||
"}"
|
||||
"]"
|
||||
"},"
|
||||
"\"checksum\":{"
|
||||
"\"size\":6"
|
||||
"}"
|
||||
"}"
|
||||
"}"
|
||||
"]"
|
||||
"}",
|
||||
// {uncrustify_on}
|
||||
"repo 1 json");
|
||||
|
||||
TEST_RESULT_VOID(jsonToVar(cmdManifestRender()), "check json");
|
||||
|
||||
argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawZ(argList, cfgOptFilter, PG_PATH_BASE "/1/2");
|
||||
HRN_CFG_LOAD(cfgCmdManifest, argList);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
cmdManifestRender(),
|
||||
"label: 20191002-070640F_20191003-105320D\n"
|
||||
"reference: 20191002-070640F, 20191002-070640F_20191003-105320D\n"
|
||||
"type: diff\n"
|
||||
"time: start: 2019-10-03 10:53:20, stop: 2019-10-04 01:27:07, duration: 14:33:47\n"
|
||||
"bundle: true\n"
|
||||
"block: true\n"
|
||||
"\n"
|
||||
"file list:\n"
|
||||
" - pg_data/base/1/2\n"
|
||||
" size: 96KB, repo 64.1KB\n"
|
||||
" checksum: d4976e362696a43fb09e7d4e780d7d9352a2ec2e\n"
|
||||
" bundle: 1\n"
|
||||
" block: size 8KB, map size 99B, checksum size 6B\n"
|
||||
" block delta:\n"
|
||||
" reference: 20191002-070640F/bundle/1, read: 1/64KB, superBlock: 2/64KB, block: 4/32KB\n"
|
||||
" reference: 20191002-070640F_20191003-105320D/bundle/1, read: 1/64KB, superBlock: 1/64KB, block: 8/64KB\n"
|
||||
" total read: 2/128KB, superBlock: 3/128KB, block: 12/96KB\n",
|
||||
"repo 1 text");
|
||||
|
||||
// Block map from repo 2
|
||||
argList = strLstDup(argListCommon);
|
||||
hrnCfgArgRawZ(argList, cfgOptFilter, PG_PATH_BASE "/1/2");
|
||||
// hrnCfgArgRawZ(argList, cfgOptSet, "20191002-070640F");
|
||||
hrnCfgArgRawZ(argList, cfgOptRepo, "2");
|
||||
hrnCfgArgRawZ(argList, cfgOptPg, "1");
|
||||
HRN_CFG_LOAD(cfgCmdManifest, argList);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
cmdManifestRender(),
|
||||
"label: 20191002-070640F_20191003-105320D\n"
|
||||
"reference: 20191002-070640F, 20191002-070640F_20191003-105320D\n"
|
||||
"type: diff\n"
|
||||
"time: start: 2019-10-03 10:53:20, stop: 2019-10-04 01:27:07, duration: 14:33:47\n"
|
||||
"bundle: true\n"
|
||||
"block: true\n"
|
||||
"\n"
|
||||
"file list:\n"
|
||||
" - pg_data/base/1/2\n"
|
||||
" size: 96KB, repo 64.1KB\n"
|
||||
" checksum: d4976e362696a43fb09e7d4e780d7d9352a2ec2e\n"
|
||||
" bundle: 1\n"
|
||||
" block: size 8KB, map size 104B, checksum size 6B\n"
|
||||
" block delta: file is up-to-date\n",
|
||||
"repo 2 test");
|
||||
|
||||
hrnCfgArgRawZ(argList, cfgOptOutput, "json");
|
||||
HRN_CFG_LOAD(cfgCmdManifest, argList);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
cmdManifestRender(),
|
||||
// {uncrustify_off - indentation}
|
||||
"{"
|
||||
"\"label\":\"20191002-070640F_20191003-105320D\","
|
||||
"\"reference\":["
|
||||
"\"20191002-070640F\","
|
||||
"\"20191002-070640F_20191003-105320D\""
|
||||
"],"
|
||||
"\"type\":\"diff\","
|
||||
"\"time\":{"
|
||||
"\"start\":1570100000,"
|
||||
"\"copy\":1570100001,"
|
||||
"\"stop\":1570152427"
|
||||
"},"
|
||||
"\"bundle\":{"
|
||||
"\"bundle\":true,"
|
||||
"\"raw\":true"
|
||||
"},"
|
||||
"\"block\":{"
|
||||
"\"block\":true"
|
||||
"},"
|
||||
"\"fileList\":["
|
||||
"{"
|
||||
"\"name\":\"pg_data/base/1/2\","
|
||||
"\"size\":98304,"
|
||||
"\"checksum\":\"d4976e362696a43fb09e7d4e780d7d9352a2ec2e\","
|
||||
"\"repo\":{"
|
||||
"\"size\":65668"
|
||||
"},"
|
||||
"\"bundle\":{"
|
||||
"\"id\":1,"
|
||||
"\"offset\":8216"
|
||||
"},"
|
||||
"\"block\":{"
|
||||
"\"size\":8192,"
|
||||
"\"map\":{"
|
||||
"\"size\":104,"
|
||||
"\"delta\":null"
|
||||
"},"
|
||||
"\"checksum\":{"
|
||||
"\"size\":6"
|
||||
"}"
|
||||
"}"
|
||||
"}"
|
||||
"]"
|
||||
"}",
|
||||
// {uncrustify_on}
|
||||
"repo 2 test");
|
||||
|
||||
TEST_RESULT_VOID(jsonToVar(cmdManifestRender()), "check json");
|
||||
}
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RETURN_VOID();
|
||||
}
|
Loading…
Reference in New Issue
Block a user