-
Notifications
You must be signed in to change notification settings - Fork 10
/
test.cpp
46 lines (38 loc) · 1.39 KB
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "docker.h"
int main(){
std::string test_id("35d4e9a5886c");
JSON_DOCUMENT doc;
Docker client = Docker();
/*
* START testing individual APIs
*/
//doc = client.system_info();
//doc = client.docker_version();
//doc = client.list_images();
//doc = client.list_containers(true);
//doc = client.start_container(test_id);
//doc = client.inspect_container(test_id);
//doc = client.top_container(test_id);
//doc = client.logs_container(test_id);
//JSON_DOCUMENT param(rapidjson::kObjectType);
//JSON_VALUE commands(rapidjson::kArrayType);
//commands.PushBack("/bin/bash", param.GetAllocator());
//param.AddMember("Cmd", commands, param.GetAllocator());
//param.AddMember("Image", "ubuntu:16.04", param.GetAllocator());
//doc = client.create_container(param);
//doc = client.start_container(test_id);
//doc = client.get_container_changes(test_id);
//doc = client.stop_container(test_id);
//doc = client.kill_container(test_id);
//doc = client.pause_container(test_id);
//doc = client.wait_container(test_id);
//doc = client.delete_container(test_id);
//doc = client.unpause_container(test_id);
//doc = client.restart_container(test_id);
//doc = client.attach_to_container(test_id);
std::cout << jsonToString(doc) << std::endl;
/*
* END testing individual APIs
*/
return 0;
}