LoginSignup
0
0

More than 3 years have passed since last update.

R1Soft/IderaでのAPI実行方法例

Last updated at Posted at 2018-02-15

1. API Referenceのありか

http://<R1SoftServer>/apidocにある。

image.png

2. Sample APIの場所

例えばライセンス情報を取得するためのサンプルAPIは以下に載っている。
http://wiki.r1soft.com/display/ServerBackup/getServerInformation

3. Sample APIの使い方

このサンプルは全部phpなので、まずはphpを導入する必要がある。

[root@myr1soft ~]# yum install -y php.x86_64 php-soap.x86_64

SampleAPIを適当なファイルに保存し(例えばgetServerLicenseInformation.phpなど)、

  1. $HOST$PASSを適切なIPアドレスおよびパスワードに変更する。
  2. phpスクリプトとしてとして動かすために、最初と最後に<?php?>を挿入する。
getServerLicenseInformation.php
<?php
########====CDP Server Configuration Start====########
#set CDP server host name
$HOST="xxxxxxx"; 
#set CDP server to access API
$PORT="9443";
#set CDP user
$USER="admin";
#set CDP user password
$PASS="xxxxxxx";
########====CDP Server Configuration End====########
#Retrieve license details for your host server.
try{

    $client = new soapclient("https://$HOST:$PORT/Configuration?wsdl",
        array('login'=>"$USER",
        'password'=>"$PASS",
        'trace'=>1
        )
    );

     $response=$client->getServerLicenseInformation() ;
     var_dump($response);

    echo "Successfully executed getServerLicenseInformation\n";

    exit(0);

}
catch (SoapFault $exception)
{
    echo $exception;
    exit(1);
}
?>

4. 実行例

[root@myr1soft ~]# php getServerLicenseInformation.php
object(stdClass)#2 (1) {
  ["return"]=>
  object(stdClass)#3 (18) {
    ["advancedEdition"]=>
    bool(false)
    ["currentAgentCount"]=>
    int(0)
    ["currentLongTermArchiveCount"]=>
    int(0)
    ["currentVirtualAgentCount"]=>
    int(0)
    ["currentVirtualizationCount"]=>
    int(0)
    ["enterpriseEdition"]=>
    bool(true)
    ["licenseAgentCount"]=>
    int(10)
    ["licenseKey"]=>
    string(36) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ["licenseVirtualAgentCount"]=>
    int(0)
    ["pooledLicense"]=>
    bool(true)
    ["standardEdition"]=>
    bool(false)
    ["timeLimitReportEnabled"]=>
    bool(false)
    ["timeLimited"]=>
    bool(false)
    ["totalLongTermArchiveCount"]=>
    int(0)
    ["totalVirtualizationCount"]=>
    int(0)
    ["trial"]=>
    bool(false)
    ["valid"]=>
    bool(true)
    ["version"]=>
    string(5) "6.6.1"
  }
}
Successfully executed getServerLicenseInformation
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0