ライセンスのインストール
製品バージョン:10.11
最終更新日:2024年7月31日
製品ライセンスをインストールします。詳細については、「ライセンス」を参照してください。
エンドポイント
https://<Director_IP_address>:4443/c/router
リクエスト例
このメソッドは、 multipart/form-data JSONボディの代わりにアップロードを受け取ります。各リクエストフィールド(action, method、 data、 type、および tid)を個別のフォームフィールドとして送信してください。ライセンスファイルを licenseFile フォームフィールドとして送信してください:これは dataの一部ではありません。
curl --request POST \
--url https://<Director_IP_address>:4443/c/router \
--cookie cookies.txt \
--header "content-type: multipart/form-data" \
--form licenseFile=@ent.lic \
--form action=LicensingManagement \
--form method=installLicense \
--form tid=1 \
--form type=rpc \
--form data=[true]
リクエストフィールド
|
フィールド
|
種類
|
値(複数可)
|
説明 |
|---|---|---|---|
licenseFile |
文字列 |
|
アップロードするライセンスファイルの保存場所 |
action |
文字列 |
|
呼び出されるアクション |
method
|
文字列 |
|
呼び出されるメソッド |
data
|
配列 |
|
要素が1つの配列(ブール値): true バックグラウンドでライセンスをインストールし、 false ライセンスのインストールが完了するまで待機します。スクリプト内で false インストールが完了するまで待機する必要があるスクリプト内で使用してください |
type
|
文字列 |
|
通信プロトコルの種類 |
tid
|
整数 |
|
トランザクションID。クライアントとサーバーの両方がリクエストを識別するために使用される |
注意!!!
PowerShell スクリプトを使用してライセンスをインストールできます。例については以下をご覧ください。
# Get the cookies from the login call
$Cookie = New-Object System.Net.Cookie;
$Cookie.Name = "JSESSIONID-1518008951"; # Example, replace the string
$Cookie.Value = "1B02CE0DD33B4BFB926EFD44516523AB"; # Example, replace the string
$Cookie.Domain = "localhost";
$WebSession = New-Object Microsoft.PowerShell.Commands.WebRequestSession;
$WebSession.Cookies.Add($Cookie);
$LF = "`r`n";
$boundary = [System.Guid]::NewGuid().ToString()
$fileBytes = [System.IO.File]::ReadAllBytes('e:\trial.bin'); # License file, replace the path
$fileEnc = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString($fileBytes);
$tid = 1; # Use an auto-increment instead of fixed number
# Build body for the form-data manually since PS does not support multipart/form-data out of the box
$bodyLines = (
"--$boundary",
"Content-Disposition: form-data; name=`"action`"",
'',
'LicensingManagement',
"--$boundary",
"Content-Disposition: form-data; name=`"method`"",
'',
'installLicense',
"--$boundary",
"Content-Disposition: form-data; name=`"type`"",
'',
'rpc',
"--$boundary",
"Content-Disposition: form-data; name=`"tid`"",
'',
$tid,
"--$boundary",
"Content-Disposition: form-data; name=`"data`"",
'',
'[true]', # true=async, false=sync (wait for install)
"--$boundary",
"Content-Disposition: form-data; name=`"licenseFile`"; filename=`"trial.bin`"",
"Content-Type: application/octet-stream",
'',
$fileEnc,
"--$boundary--"
) -join $LF
# Allow self-signed certificate
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
# Use TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$uri = 'https://localhost:4443/c/router';
Invoke-RestMethod -Verbose -Uri $uri -Method Post -ContentType "multipart/form-data; boundary=$boundary" -Body $bodyLines -WebSession $webSession;
回答例
{
"action": "LicensingManagement",
"method": "installLicense",
"tid": "1",
"type": "rpc",
"message": null,
"where": null,
"cause": null,
"data": null
}
応答フィールド
|
フィールド
|
値
|
説明
|
|---|---|---|
message
|
文字列 | リクエストが失敗した場合はメッセージを表示する |
where
|
文字列 | 問題が発生した手法に関する言及 |
cause
|
文字列 | 故障の原因 |
| データ | 文字列 |
|