• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Sample Server Development Overview
2<!--Kit: Basic Services Kit-->
3<!--Subsystem: Update-->
4<!--Owner: @RainyDay_005; @huangsiping3-->
5<!--Designer: @zhangzhengxue; @jackd320-->
6<!--Tester: @mamba-ting-->
7<!--Adviser: @zhang_yixin13-->
8
9The sample server provides a simple server instance for deploying update packages. It can be used as an auxiliary test environment for the UpdateService subsystem.
10
11## When to Use
12
13In actual applications, developers need to query and download update packages from the server. The sample server provides the following functions:
14
15- Update package query: The server returns the version information of the update package.
16
17- Update package download: The server returns the download link of the update package.
18
19The sample server supports update service testing and secondary development function verification, building an end-to-end environment to cater for diverse update service use cases.
20
21## Basic Concepts
22
23- Package search service: one of the service capabilities provided by the UpdateService. It depends on the server that supports the TCP and SSL protocols.
24
25- Package search server: a server that provisions the package search service through the TCP connection and the SSL protocol. The sample server mentioned in this document is such a package search server.
26
27- Download server: an HTTP server.
28
29- update.serverip.search: a system parameter that indicates the IP address of the package search server configured on the UpdateService. The default value is **127.0.0.1**.
30
31## Constraints
32
33- The following is an example of the json response returned by the server. Note that the **verifyInfo** field indicates the SHA-256 value of the update package, and the **size** field indicates the size of the update package, in bytes.
34
35```json
36{
37    "searchStatus": 0,
38    "errMsg": "success",
39    "checkResults": [{
40        "versionName": "versionNameSample",
41        "versionCode": "versionCodeSample",
42        "verifyInfo": "verifyInfoSHA256Value1234567",
43        "size": 1234567,
44        "packageType": 1,
45        "url": "http://serverAddressSample/packageNameSample.fileTypeSample",
46        "descriptPackageId": "abcdefg1234567ABCDEFG"
47    }],
48    "descriptInfo": [{
49        "descriptionType": 0,
50        "content": "This package is used for update."
51    }]
52}
53```
54