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

Commit2f62b1b

Browse files
committed
Adding a license cluster command
1 parent3dce9a2 commit2f62b1b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎es.go‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,3 +1802,24 @@ func (c *Client) RemoveIndexILMPolicy(index string) error {
18021802

18031803
returnnil
18041804
}
1805+
1806+
// Function called LicenseCluster. This function takes a json document as a string which is the license to apply to the Elasticsearch cluster.
1807+
func (c*Client)LicenseCluster(licensestring)error {
1808+
// If the license is empty, return an error
1809+
iflicense=="" {
1810+
returnerrors.New("license is required")
1811+
}
1812+
1813+
// Build the request to apply the license to the cluster
1814+
agent:=c.buildPutRequest("_license").
1815+
Set("Content-Type","application/json").
1816+
Send(license)
1817+
1818+
// Execute the request
1819+
_,err:=handleErrWithBytes(agent)
1820+
iferr!=nil {
1821+
returnerr
1822+
}
1823+
1824+
returnnil
1825+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp