-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprotocol.txt
150 lines (125 loc) · 4.34 KB
/
protocol.txt
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
This file describes simple structure of network protocol used by SSDS.
Right now there are only few tags but in time we will add more tags to support additional functionality.
The protocol between client and server has following simple JSON structure:
{
"code" : Number, //Code of the message identifying type of message - codes are explained later
"data" : {} //The tags that are present here depend on code above
}
================================================================================================
"data" object desribed here:
packages requested by client to be installed, upgraded etc.:
"req_pkgs" : [ "package-1", "package-2", ... "package-n"],
whether client wants to install, update, upgrade etc.:
"req_operation" : ["command-1", "command-2", ... "command-n"],
known repos on client side:
"repolist" :
[
{
"name" : String, //name of the repo - maybe this is not important
"repo_url" : [String, String ...], //there can be more than one url to try for a repo
"type" : Number //1-baseurl, 2-mirrorlist, 3-metalink
},
{}...
]
values from dnf.conf from client to be considered on server side when dealing with dependencies
"dnf_conf" :
{
option-name : String,
...
option-name : String
}
installed packages on client side - two options here:
-send @System.solv as a seperate file
-send @System.solv inside json
Example:
{
"code" : 1,
"data" :
{
"req_pkgs" : ["abakus", "emacs"],
"req_operation" : ["install"],
"repolist" :
[
{
"repo_url" : ["https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch"],
"name" : "Fedora",
"type" : 3
},
{}
],
"dnf_conf" :
{}
}
}
================================================================================================
possible child tags of "data" sent from server side:
result of dependency solving - packages to install:
"install" : [
{
"pkg_name": String,
"pkg_loc": pkg1,
"base_url": String, (even NULL)
//if download_address will be removed
"metalink": String
//if download_address will stay
"metalink": Int
},
{pkg2}, {pkg3} ... ]
"erase" : [pkg1, pkg2, pkg3 ...]
"update" : [pkg1, pkg2, pkg3 ...] // same as in install array
},
{}...
],
"download_address" : [addr1, addr2, addr3 ...]
Example coresponding to client example above:
{
"code" : 1,
"data" :
{
"install" :
[
{
"pkg_name":"why-xemacs-2.34-13.fc21-noarch",
"pkg_loc": "Packages/w/why-xemacs-2.34-13.fc21-noarch.rpm",
"base_url": NULL,
//if download_address will be removed vvvv
"metalink": "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f21&arch=x86_64"
//if download_address will stay
"metalink": 0
} // vvvv same as previous
"why-2.34-13.fc21-x86_64",
"xemacs-21.5.34-8.20140605hgacf1c26e3019.fc21-x86_64",
"Canna-libs-3.7p3-44.fc21-x86_64",
"compface-1.5.2-18.fc21-x86_64",
"neXtaw-0.15.1-22.fc21-x86_64",
"xemacs-common-21.5.34-8.20140605hgacf1c26e3019.fc21-x86_64",
"xemacs-packages-base-20140715-1.fc21-noarch",
"xorg-x11-fonts-ISO8859-1-100dpi-7.5-14.fc21-noarch",
"xorg-x11-fonts-ISO8859-1-75dpi-7.5-14.fc21-noarch"
],
"erase" : [],
"upgrade" : []
"download_address":
[
"https://mirrors.fedoraproject.org/metalink?repo=updates-released-f21&arch=x86_64",
"https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64"
]
},
{
"name" : "abakus",
"install" : ["abakus-0.92-4.fc21-x86_64"],
"erase" : [],
"upgrade" : []
}
],
}
}
================================================================================================
possible error messages from client side:
================================================================================================
possible error messages from server side:
================================================================================================
<!--Possible error codes-->
000-099 are regular commands or info
100-199 are ssds error messages (mostly about dependency solving errors etc.)
200-299 are internal server errors