A CRUD Interface for interacting with hostname table of Clickhouse
hostname_data with given id:
Path: /api/chf/cmm/hostnames/id
Method: GET
Response: hostname_data object
{
"message": "Success",
"data": {
"id": 2,
"ip": "1.1.1.2",
"hostname": "www.profitap2.com",
"begin_ts": 121313123123,
"end_ts": 131313123124
}
}id this is integer unique identifier
ip is a valid ipv4 or ipv6 string
begin_ts (optional) is the starting timestamp of the validity of this name
end_ts (optional) is the end timestamp of the validity of this name
hostname is a valid hostname string
hostname_data:
Path: /api/chf/cmm/hostnames
Method: GET
Response:
{
"message": "Success",
"data": [
{
"id": 1,
"ip": "1.1.1.1",
"hostname": "www.profitap1.com"
},
{
"id": 2,
"ip": "1.1.1.2",
"hostname": "www.profitap2.com",
"begin_ts": 121313123123,
"end_ts": 131313123124
}
]
}Description:
message is the total number of entries in the internal storagedata is the array containing the values for the requested page
id is a id string with format id string format is 8bytes-4bytes-4bytes-4bytes-12bytes (example: 34675b42-aaf2-4649-826b-a99dbbef56da)ip the entry ip addresshostname the entry hostnamebegin_ts the entry start timestampend_ts the entry end timestamphostname_data
Path: /api/chf/cmm/hostnames
Method: POST
Arguments:
Body parameters:
[
{
[mandatory]"ip" : "1.1.1.5",
[optional]"begin_ts" : null,
[optional]"end_ts" : null,
[mandatory]"hostname" : "www.profitap5.com"
},
{
[mandatory]"ip" : "1.1.1.6",
[optional]"begin_ts" : 121313123123, // it's is the starting timestamp of the validity of this name. If provided, `end_ts` must also be provided.
[optional]"end_ts" : 131313123124, // it's is the end timestamp of the validity of this name. If provided, `begin_ts` must also be provided.
[mandatory]"hostname" : "www.profitap6.com"
},
....
]Response:
{
"message": "Success",
"data": [
{
"id": 1,
"ip": "1.1.1.5",
"hostname": "www.profitap5.com",
"begin_ts" : null,
"end_ts" : null,
},
{
"id": 2,
"ip": "1.1.1.6",
"hostname": "www.profitap6.com",
"begin_ts" : 121313123123,
"end_ts" : 131313123124,
},
....
]
}id
Path: /api/chf/cmm/hostnames
Method: PUT
Arguments:
idOnly the fields that needs to be changed can be sent
[
{
[mandatory]"id" : 1,
[optional]"ip" : "1.1.1.1",
[optional]"begin_ts" : 121313123123,
[optional]"end_ts" : 131313123124,
[optional]"hostname" : "www.profitap1.com"
},
{
[mandatory]"id" : 2,
[optional]"ip" : "1.1.1.1",
[optional]"begin_ts" : 121313123123,
[optional]"end_ts" : 131313123124,
[optional]"hostname" : "www.profitap2.com"
},
....
]Response:
[
{
"id" : 1,
"ip" : "1.1.1.1",
"begin_ts" : 121313123123,
"end_ts" : 131313123124,
"hostname" : "www.profitap1.com"
},
{
"id" : 2,
"ip" : "1.1.1.1",
"begin_ts" : 121313123123,
"end_ts" : 131313123124,
"hostname" : "www.profitap2.com"
},
....
]id
/api/chf/cmm/hostnames/{id}DELETEResponse:
{
"message": "Successfully removed the metadata entry with given id: '{id}'",
"data": null
}/api/chf/cmm/hostnamesDELETEResponse:
{
"message": "successfully cleared the metadata entries",
"data": null
}