Installer la licence
Version du produit: 10.11
Dernière modification: 31 juillet 2024
Installe une licence de produit. Pour plus de détails, consultez la rubrique « Octroi de licences ».
Point d'extrémité
https://<Director_IP_address>:4443/c/router
Exemple de demande
Cette méthode utilise un multipart/form-data fichier téléchargé au lieu d'un corps JSON. Envoyez chaque champ de la requête (action, method, data, type, et tid) sous la forme d'un champ de formulaire distinct. Envoyez le fichier de licence dans le licenseFile champ du formulaire : il ne fait pas partie de 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]
Champs de la requête
|
Champ
|
Type
|
Valeur(s)
|
Description |
|---|---|---|---|
licenseFile |
chaîne de caractères |
|
Emplacement du fichier de licence à télécharger |
action |
chaîne |
|
L'action qui est déclenchée |
method
|
chaîne de caractères |
|
La méthode qui est appelée |
data
|
tableau |
|
Tableau à un élément (booléen) : true installe la licence en arrière-plan, false attend que la licence soit installée. Utilisez false dans un script qui doit attendre la fin de l'installation |
type
|
chaîne de caractères |
|
Type de protocole de communication |
tid
|
entier |
|
Identifiant de transaction. Permet d'identifier la requête tant par le client que par le serveur |
Remarque !!!
Vous pouvez installer votre licence à l'aide d'un script PowerShell. Vous trouverez ci-dessous un exemple.
# 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;
Exemple de réponse
{
"action": "LicensingManagement",
"method": "installLicense",
"tid": "1",
"type": "rpc",
"message": null,
"where": null,
"cause": null,
"data": null
}
Champs de réponse
|
Champ
|
Valeur
|
Description
|
|---|---|---|
message
|
chaîne | Message en cas d'échec de la requête |
where
|
chaîne de caractères | Référence à la méthode dans laquelle le problème s'est produit |
cause
|
chaîne | Cause de la défaillance |
| données | chaîne de caractères |
|