このページでは、エージェントインストーラ API を使用してエージェントを展開する方法について説明します。 

エージェントインストーラ API の詳細については、「Agent Installer Platform Service API」を参照してください。 

エージェントバージョンの確認

次の API を使用して、使用可能なエージェントの最新バージョンを取得します。

形式:

GET /install/agentVersions?latest={true|false}&osType={linux|windows}

リクエストの例:

For Linux: 
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/agentVersions?latest=false&osType=linux --header 'Authorization: Bearer {AuthToken}'

For Windows: 
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/agentVersions?latest=false&osType=windows --header 'Authorization: Bearer {AuthToken}'
CODE

応答の例:

{
    "total": 1,
    "items": [
        {
            "os": "linux",
            "agents": [
                {
                    "agentType": "sun_java",
                    "descriptions": [
                        {
                            "version": "21.8.0.32958",
                            "md5Checksum": "ca5472b4c6691d65f35399bc61a4c180",
                            "s3Path": "download-file/sun-jvm/21.8.0.32958/AppServerAgent-21.8.0.32958.zip",
                            "supportsIbl": false
                        }
                    ]
                },
                {
                    "agentType": "ibm_java",
                    "descriptions": [
                        {
                            "version": "21.8.0.32958",
                            "md5Checksum": "eb35b7dfb1166c7a20586e30d231f337",
                            "s3Path": "download-file/ibm-jvm/21.8.0.32958/AppServerAgent-ibm-21.8.0.32958.zip",
                            "supportsIbl": false
                        }
                    ]
                },
                {
                    "agentType": "machine",
                    "descriptions": [
                        {
                            "version": "21.7.0.3160",
                            "md5Checksum": "24cd76b6144c56c78063112f154b53bd",
                            "s3Path": "download-file/machine-bundle/21.7.0.3160/machineagent-bundle-64bit-linux-21.7.0.3160.zip",
                            "supportsIbl": true
                        }
                    ]
                },
                {
                    "agentType": "infra",
                    "descriptions": [
                        {
                            "version": "21.5.0.1826",
                            "md5Checksum": "6df412722d125dc058d35d8cd39a39df",
                            "s3Path": "download-file/infra-agent/21.5.0.1826/appdynamics-infra-agent-linux-64-21.5.0.1826.zip",
                            "supportsIbl": false
                        }
                    ]
                },
                {
                    "agentType": "zero",
                    "descriptions": [
                        {
                            "version": "21.9.0.569",
                            "md5Checksum": "720597f2dc67ecf0b5f02b45b51d46ee",
                            "s3Path": "download-file/zero-agent/21.9.0.569/appdynamics-zero-agent-21.9.0.569.zip",
                            "supportsIbl": false
                        }
                    ]
                }
            ]
        }
    ]
}
CODE

ダウンロードコマンドの取得

上記の API で取得したバージョンを使用して、次の API からダウンロードコマンドを取得します。

形式:

GET /install/downloadCommand?javaVersion={javaVersion}&machineVersion={machineVersion}&zeroVersion={zeroVersion}&multiline={true|false}&osType={windows|linux}

リクエストの例:

For Linux: 
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/downloadCommand?javaVersion=latest&machineVersion=21.10.0.3188&zeroVersion=latest&multiline=true&osType=linux' --header 'Authorization: Bearer {AuthToken}'

For Windows: 
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/downloadCommand?machineVersion=21.10.0.3188&zeroVersion=latest&multiline=true&osType=windows' --header 'Authorization: Bearer {AuthToken}'
CODE

応答の例:

For Linux:
[
    "cd $(mktemp -d -t appd-zero-XXXXXXX)",
    "&& curl https://download-files.saas.appdynamics.com/download-file/zero-agent-bootstrap/22.2.0.1462/appdynamics-zero-agent-bootstrap-22.2.0.1462.sh -o zero-agent.sh",
    "&& chmod +x zero-agent.sh",
    "&& ./zero-agent.sh download sun-java -u https://download-files.saas.appdynamics.com -v 22.1.0.33445 -c ced8b1d5d8739753df9de6a5465a1431",
    "&& ./zero-agent.sh download ibm-java -u https://download-files.saas.appdynamics.com -v 22.1.0.33445 -c 70a2017fbc722844b7dc61efd516a962",
    "&& ./zero-agent.sh download machine -u https://download-files.saas.appdynamics.com -v 21.10.0.3188 -c 186b1fc26f8a2626269cd54cadf45e1e",
    "&& ./zero-agent.sh download zero -u https://download-files.saas.appdynamics.com -v 22.2.0.1462 -c 318aa43165c8279bbffacd1c4120d1cd"
]

For Windows: 
[
    "$ProgressPreference = 'SilentlyContinue';",
    "$tmpfolder = Join-Path ([System.IO.Path]::GetTempPath()) appd-zero-$([System.IO.Path]::GetRandomFileName());",
    "New-Item -ItemType Directory -Force -Path $tmpfolder | out-null;",
    "Set-Location -Path $tmpfolder;",
    "Invoke-WebRequest https://download-files.saas.appdynamics.com/download-file/zero-agent-bootstrap/22.2.0.1462/appdynamics-zero-agent-bootstrap-22.2.0.1462.ps1 -OutFile zero-agent.ps1;",
    "Set-ExecutionPolicy ByPass -Force -Scope CurrentUser;",
    ".\\zero-agent.ps1 download machine -u https://download-files.saas.appdynamics.com -v 21.10.0.3188 -c bd3d78a412b66f7d0a08cd6f856abb89;",
    ".\\zero-agent.ps1 download zero -u https://download-files.saas.appdynamics.com -v 22.2.0.1462 -c b9a6f11027f485468ba8224bf60586c6;"
]
CODE

インストールコマンドの取得

コマンドを実行すると、新しい一時ディレクトリに移動します。次の API からコマンドを取得し、同じディレクトリから実行します。

形式:

GET /install/installCommand?sudo={true|false}&application={appName}&accessKey={accessKey}&serviceUrl={serviceUrl}&osType={windows|linux}

リクエストの例:

For Linux:  
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/installCommand?sudo=true&application=helloWorld&accessKey=fb19d1d6-6858-5fea-b6ed-302480e5c580&serviceUrl=https://demo.saas.appdynamics.com&osType=linux' --header 'Authorization: Bearer {AuthToken}'

For Windows:  
curl --location --request GET 'https://demo.saas.appdynamics.com/zero/v1beta/install/installCommand?application=helloWorld&accessKey=fb19d1d6-6858-5fea-b6ed-302480e5c580&serviceUrl=https://demo.saas.appdynamics.com&osType=windows' --header 'Authorization: Bearer {AuthToken}'
CODE

応答の例:

For Linux:  
[
    "sudo ./zero-agent.sh install --application 'helloWorld' --account 'demo' --access-key 'fb19d1d6-6858-5fea-b6ed-302480e5c580' --service-url 'https://demo.saas.appdynamics.com'"
] 

For Windows:  
[
    ".\\zero-agent.ps1 install --application 'helloWorld' --account 'demo' --access-key 'fb19d1d6-6858-5fea-b6ed-302480e5c580' --service-url 'https://demo.saas.appdynamics.com'"
]
CODE