Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
/vulcanizerPublic archive

Commitaef7e71

Browse files
committed
feature: added SnapshotAllIndicesWithBodyParams function
1 parent0c26877 commitaef7e71

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

‎es.go‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,34 @@ func (c *Client) SnapshotAllIndices(repository string, snapshot string) error {
11741174
returnerr
11751175
}
11761176

1177+
func (c*Client)SnapshotAllIndicesWithBodyParams(repositorystring,snapshotstring,bodyParamsmap[string]interface{})error {
1178+
ifrepository=="" {
1179+
returnerrors.New("empty string for repository is not allowed")
1180+
}
1181+
1182+
ifsnapshot=="" {
1183+
returnerrors.New("empty string for snapshot is not allowed")
1184+
}
1185+
1186+
ifbodyParams==nil {
1187+
returnerrors.New("no body params provided, please use SnapshotAllIndices Function instead")
1188+
}
1189+
1190+
parsedJson,parsingErr:=json.Marshal(bodyParams)
1191+
1192+
ifparsingErr!=nil {
1193+
returnparsingErr
1194+
}
1195+
1196+
agent:=c.buildPutRequest(fmt.Sprintf("_snapshot/%s/%s",repository,snapshot)).
1197+
Set("Content-Type","application/json").
1198+
Send(parsedJson)
1199+
1200+
_,err:=handleErrWithBytes(agent)
1201+
1202+
returnerr
1203+
}
1204+
11771205
// Restore an index or indices on the cluster
11781206
//
11791207
// Use case: You want to restore a particular index or indices onto your cluster with a new name.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp