Quản lý Hosting
Quản lý Hosting: Danh sách, Thông tin chi tiết, Tra cứu, Bảo mật, Quản lý, Hành động
Tổng quan
Quản lý Hosting: Danh sách, Thông tin chi tiết, Tra cứu, Bảo mật, Quản lý, Hành động
- Danh sách: Danh sách Addon Domain, Danh sách Hosting, Danh sách IP Addon
- Thông tin chi tiết: Chi tiết Hosting
- Tra cứu: Lấy Hosting theo Domain ID
- Bảo mật: Gỡ Firewall Hosting, Kiểm tra Firewall Hosting, Reset mật khẩu Hosting
- Quản lý: Cập nhật ghi chú Hosting, Đổi tên miền chính cho Hosting, Thêm Addon Domain
- Authentication: API key Bearer token qua header
Authorization: Bearer YOUR_API_KEY
Base URL: https://developers-dev.inet.vn/api/gateway/v1
Response wrapper: Tất cả response được wrap trong { success, data, meta }. Response schema bên dưới mô tả nội dung field data. Xem chi tiết tại Response Format.
Danh sách
Danh sách Addon Domain
GET /hosting/{hostingId}/addon
Lấy danh sách addon domain của gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/addon"Danh sách Hosting
GET /hosting
Lấy danh sách gói Hosting của khách hàng, hỗ trợ phân trang và lọc theo trạng thái.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
name | query | string | Không | Lọc theo tên hosting (để trống = tất cả) |
status | query | string | Không | Lọc theo trạng thái (vd: active,trial,suspended) |
page | query | integer | Không | Số trang (bắt đầu từ 1) |
pageSize | query | integer | Không | Số bản ghi mỗi trang |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting"Response
{
"size": 1,
"number": 1,
"content": [
{
"id": 1,
"type": "example_type",
"planId": 1,
"status": "example_status",
"planName": "CH-01",
"roidType": "example_roidType",
"serverIp": "example_serverIp",
"trialDay": 1,
"issueDate": "example_issueDate",
"ownerView": true,
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"renewTrial": true,
"serverName": "example_serverName",
"createdDate": "example_createdDate",
"onlyInSystem": true
}
],
"totalPages": 1,
"totalElements": 1,
"numberOfElements": 1
}
| Trường | Kiểu | Mô tả |
|---|---|---|
size | integer | Kích thước trang |
number | integer | Trang hiện tại (0-based) |
content | array | Danh sách hosting |
content[].id | integer | ID hosting |
content[].type | string | Loại hosting: cloud-hosting, cloud-wordpress, seo-class-c... |
content[].planId | integer | ID gói hosting |
content[].status | string | Trạng thái: active, suspended, trial, expired |
content[].planName | string | Tên gói hosting (VD: CH-01, WP-H1) |
content[].roidType | string | Loại dịch vụ (hosting) |
content[].serverIp | string | IP server |
content[].trialDay | integer | Số ngày dùng thử (0 = không trial) |
content[].issueDate | string | Ngày cấp (MM/dd/yyyy HH:mm) |
content[].ownerView | boolean | Quyền xem chủ sở hữu |
content[].domainName | string | Tên miền gắn hosting |
content[].expireDate | string | Ngày hết hạn (MM/dd/yyyy HH:mm) |
content[].renewTrial | boolean | Gia hạn dùng thử |
content[].serverName | string | URL server hosting panel |
content[].createdDate | string | Ngày tạo |
content[].onlyInSystem | boolean | Chỉ tồn tại trong hệ thống |
totalPages | integer | Tổng số trang |
totalElements | integer | Tổng số bản ghi |
numberOfElements | integer | Số phần tử trang hiện tại |
Danh sách IP Addon
GET /hosting/{hostingId}/ip-addon
Lấy danh sách IP addon của gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/ip-addon"Thông tin chi tiết
Chi tiết Hosting
GET /hosting/{hostingId}
Lấy thông tin chi tiết gói Hosting theo ID.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}"Response
{
"id": 1,
"type": "example_type",
"planId": 1,
"status": "example_status",
"planName": "example_planName",
"roidType": "example_roidType",
"serverIp": "example_serverIp",
"trialDay": 1,
"issueDate": "example_issueDate",
"ownerView": true,
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"renewTrial": true,
"serverName": "example_serverName",
"createdDate": "example_createdDate",
"onlyInSystem": true
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
type | string | Loại hosting: cloud-hosting, cloud-wordpress, seo-class-c... |
planId | integer | ID gói hosting |
status | string | Trạng thái: active, suspended, trial, expired |
planName | string | Tên gói hosting |
roidType | string | Loại dịch vụ (hosting) |
serverIp | string | IP server |
trialDay | integer | Số ngày dùng thử (0 = không trial) |
issueDate | string | Ngày cấp (MM/dd/yyyy HH:mm) |
ownerView | boolean | Quyền xem chủ sở hữu |
domainName | string | Tên miền gắn hosting |
expireDate | string | Ngày hết hạn |
renewTrial | boolean | Gia hạn dùng thử |
serverName | string | URL server hosting panel |
createdDate | string | Ngày tạo |
onlyInSystem | boolean | Chỉ tồn tại trong hệ thống |
Tra cứu
Lấy Hosting theo Domain ID
GET /hosting/by-domain/{domainId}
Lấy thông tin gói Hosting gắn với tên miền. Path param là Domain ID (không phải Hosting ID).
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
domainId | path | integer | Có | ID của tên miền (Domain ID, không phải Hosting ID) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/by-domain/{domainId}"Response
{
"id": 1,
"type": "example_type",
"planId": 1,
"status": "example_status",
"planName": "example_planName",
"roidType": "example_roidType",
"serverIp": "example_serverIp",
"trialDay": 1,
"issueDate": "example_issueDate",
"ownerView": true,
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"serverName": "example_serverName",
"onlyInSystem": true
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
type | string | Loại hosting |
planId | integer | ID gói hosting |
status | string | Trạng thái: active, suspended, trial, expired |
planName | string | Tên gói hosting |
roidType | string | Loại dịch vụ |
serverIp | string | IP server |
trialDay | integer | Số ngày dùng thử |
issueDate | string | Ngày cấp (MM/dd/yyyy HH:mm) |
ownerView | boolean | Quyền xem chủ sở hữu |
domainName | string | Tên miền gắn hosting |
expireDate | string | Ngày hết hạn |
serverName | string | URL server hosting panel |
onlyInSystem | boolean | Chỉ tồn tại trong hệ thống |
Bảo mật
Gỡ Firewall Hosting
DELETE /hosting/{hostingId}/firewall
Xóa IP khỏi danh sách bị block firewall của gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
targetIp | query | string | Có | IP cần gỡ block (vd: 1.2.3.4) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/firewall?targetIp=1.2.3.4"Response
{
"status": "example_status",
"message": "Đã xóa IP bị deny"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
status | string | Kết quả: success hoặc error |
message | string | Thông báo kết quả (vd: Đã xóa IP bị deny) |
Kiểm tra Firewall Hosting
GET /hosting/{hostingId}/firewall
Kiểm tra trạng thái firewall (IP có bị block không) của gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
targetIp | query | string | Có | IP cần kiểm tra (vd: 1.2.3.4) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/firewall?targetIp=1.2.3.4"Response
{
"result": {
"denied": true,
"targetIp": "example_targetIp"
},
"status": "example_status"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
result | object | Chi tiết kết quả |
result.denied | boolean | true = IP đang bị block, false = không bị block |
result.targetIp | string | IP được kiểm tra |
status | string | Kết quả: success hoặc error |
Reset mật khẩu Hosting
POST /hosting/{hostingId}/reset-password
Reset mật khẩu đăng nhập hosting panel (cPanel/DirectAdmin).
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/reset-password"Response
{
"id": 1,
"newPassword": "example_newPassword"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
newPassword | string | Mật khẩu mới |
Tạo SSH Key
POST /hosting/{hostingId}/ssh-key
Tạo SSH key cho gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
sshKeyName | string | Có | Tên SSH key (VD: malware_scan, deploy_key) |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sshKeyName":"example_sshKeyName"}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/ssh-key"Response
{
"id": 1
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
Quản lý
Cập nhật ghi chú Hosting
PATCH /hosting/{hostingId}/note
Cập nhật ghi chú cho gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
note | string | Có | Ghi chú |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/note"Response
{
"id": 1,
"note": "example_note"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
note | string | Ghi chú đã cập nhật |
Đổi tên miền chính cho Hosting
PATCH /hosting/{hostingId}/domain-name
Thay đổi tên miền gắn với gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
domainName | string | Có | Tên domain mới |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/domain-name"Response
{
"id": 1,
"status": "example_status",
"domainName": "example_domainName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
status | string | Trạng thái hosting |
domainName | string | Tên miền mới đã cập nhật |
Thêm Addon Domain
POST /hosting/{hostingId}/addon
Thêm addon domain vào gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
addonDomain | string | Có | Tên miền addon (VD: example.vn) |
hostingAddonIp | string | Có | IP addon (VD: 1.2.3.4) |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"addonDomain":"example_addonDomain","hostingAddonIp":"example_hostingAddonIp"}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/addon"Response
{
"id": 1,
"status": "example_status",
"planName": "example_planName",
"serverIp": "example_serverIp",
"addonList": [
{
"id": 1,
"ip": "example_ip",
"hostingId": 1,
"subDomain": "example_subDomain",
"addonDomain": "example_addonDomain"
}
],
"domainName": "example_domainName",
"serverName": "example_serverName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
status | string | Trạng thái hosting |
planName | string | Tên gói hosting |
serverIp | string | IP server |
addonList | array | Danh sách addon domain sau khi thêm |
addonList[].id | integer | ID addon |
addonList[].ip | string | IP addon |
addonList[].hostingId | integer | ID hosting |
addonList[].subDomain | string | Subdomain |
addonList[].addonDomain | string | Tên miền addon |
domainName | string | Tên miền chính |
serverName | string | URL server hosting panel |
Xóa Addon Domain
DELETE /hosting/{hostingId}/addon/{hostingAddonId}
Xóa addon domain khỏi gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
hostingAddonId | path | integer | Có | ID addon |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/addon/{hostingAddonId}"Response
{
"id": 1,
"status": "example_status",
"planName": "example_planName",
"serverIp": "example_serverIp",
"addonList": [
{
"id": 1,
"ip": "example_ip",
"hostingId": 1,
"subDomain": "example_subDomain",
"addonDomain": "example_addonDomain"
}
],
"domainName": "example_domainName",
"serverName": "example_serverName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
status | string | Trạng thái hosting |
planName | string | Tên gói hosting |
serverIp | string | IP server |
addonList | array | Danh sách addon domain còn lại sau khi xóa |
addonList[].id | integer | ID addon |
addonList[].ip | string | IP addon |
addonList[].hostingId | integer | ID hosting |
addonList[].subDomain | string | Subdomain |
addonList[].addonDomain | string | Tên miền addon |
domainName | string | Tên miền chính |
serverName | string | URL server hosting panel |
Hành động
Đăng nhập Hosting Panel
POST /hosting/{hostingId}/login
Lấy URL đăng nhập tự động vào hosting panel (cPanel/DirectAdmin).
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/login"Response
{
"url": "example_url"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
url | string | URL đăng nhập tự động vào hosting panel (chứa access_token, có thời hạn) |
Đồng bộ Addon Domain
POST /hosting/{hostingId}/addon/sync
Đồng bộ lại danh sách addon domain của gói Hosting.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/addon/sync"Response
{
"id": 1,
"type": "seo-class-c",
"planId": 1,
"status": "example_status",
"planName": "Gói A",
"serverIp": "example_serverIp",
"userName": "example_userName",
"issueDate": "example_issueDate",
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"ownerEmail": "example_ownerEmail",
"serverName": "example_serverName",
"lastChangePassword": "example_lastChangePassword"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
type | string | Loại hosting (vd: seo-class-c) |
planId | integer | ID gói hosting |
status | string | Trạng thái: active, trial, suspended, expired |
planName | string | Tên gói hosting (vd: Gói A) |
serverIp | string | IP server hosting |
userName | string | Username hosting |
issueDate | string | Ngày kích hoạt (dd/MM/yyyy HH:mm) |
domainName | string | Tên miền chính của hosting |
expireDate | string | Ngày hết hạn (dd/MM/yyyy HH:mm) |
ownerEmail | string | Email chủ sở hữu |
serverName | string | URL control panel server |
lastChangePassword | string | Lần đổi mật khẩu cuối (dd/MM/yyyy HH:mm) |
Restart Hosting
POST /hosting/{hostingId}/restart
Suspend và unsuspend gói Hosting (restart).
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
hostingId | path | integer | Có | ID hosting |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/restart"Response
{
"id": 1,
"status": "example_status"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID hosting |
status | string | Trạng thái sau khi restart: active, suspended, trial |