Generate Docker Command

API Explorer: /private-locations/{harborId}/ships/{shipId}/docker-command

To generate a Docker command, you will need to know the harborId and shipId. The sample code generates a docker run command for the agent with shipId of 5d2657219583d81adc3778b4 and the private location with harborId of 5d1641a21726d36d4632fd34. To use this API, replace the harborId of 5d1641a21726d36d4632fd34 with your harborId and the shipId of 5d2657219583d81adc3778b4 with your shipId.

You will want to save the dockerCommand from the response for use in completing the agent installation process.

Generate Docker Command

curl 'https://a.blazemeter.com/api/v4/private-locations/5d1641a21726d36d4632fd34/ships/5d2657219583d81adc3778b4/docker-command' \
	-X POST \
	-H 'Content-Type: application/json' \
	--user 'api_key_id:api_key_secret'

Generate Docker Command Response Attributes

Attributes

  • dockerCommandstring

    The generated docker run command used for agent installation

Response200 OK

{
    "api_version": 4,
    "error": null,
    "result": {
        "dockerCommand": "docker run -d --env HARBOR_ID=5d1641a21726d36d4632fd34 --env SHIP_ID=5d2657219583d81adc3778b4 --env AUTH_TOKEN=3be47b20b76e228283899b482d55db7fb0f3bffac6f07fa6bbb10ddb5bcbcc8c --name=bzm-crane-5d2657219583d81adc3778b4 --restart=on-failure -v /var/run/docker.sock:/var/run/docker.sock -w /usr/src/app/ -v /tmp:/tmp --net=host blazemeter/crane python agent/agent.py"
    },
    "request_id": "5d265c1c0594e"
}