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ểuBắt buộcMô tả
hostingIdpathintegerID 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ểuBắt buộcMô tả
namequerystringKhôngLọc theo tên hosting (để trống = tất cả)
statusquerystringKhôngLọc theo trạng thái (vd: active,trial,suspended)
pagequeryintegerKhôngSố trang (bắt đầu từ 1)
pageSizequeryintegerKhôngSố bản ghi mỗi trang
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://developers-dev.inet.vn/api/gateway/v1/hosting"

Response

JSON
{
  "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ườngKiểuMô tả
sizeintegerKích thước trang
numberintegerTrang hiện tại (0-based)
contentarrayDanh sách hosting
content[].idintegerID hosting
content[].typestringLoại hosting: cloud-hosting, cloud-wordpress, seo-class-c...
content[].planIdintegerID gói hosting
content[].statusstringTrạng thái: active, suspended, trial, expired
content[].planNamestringTên gói hosting (VD: CH-01, WP-H1)
content[].roidTypestringLoại dịch vụ (hosting)
content[].serverIpstringIP server
content[].trialDayintegerSố ngày dùng thử (0 = không trial)
content[].issueDatestringNgày cấp (MM/dd/yyyy HH:mm)
content[].ownerViewbooleanQuyền xem chủ sở hữu
content[].domainNamestringTên miền gắn hosting
content[].expireDatestringNgày hết hạn (MM/dd/yyyy HH:mm)
content[].renewTrialbooleanGia hạn dùng thử
content[].serverNamestringURL server hosting panel
content[].createdDatestringNgày tạo
content[].onlyInSystembooleanChỉ tồn tại trong hệ thống
totalPagesintegerTổng số trang
totalElementsintegerTổng số bản ghi
numberOfElementsintegerSố 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ểuBắt buộcMô tả
hostingIdpathintegerID 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ểuBắt buộcMô tả
hostingIdpathintegerID hosting
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}"

Response

JSON
{
  "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ườngKiểuMô tả
idintegerID hosting
typestringLoại hosting: cloud-hosting, cloud-wordpress, seo-class-c...
planIdintegerID gói hosting
statusstringTrạng thái: active, suspended, trial, expired
planNamestringTên gói hosting
roidTypestringLoại dịch vụ (hosting)
serverIpstringIP server
trialDayintegerSố ngày dùng thử (0 = không trial)
issueDatestringNgày cấp (MM/dd/yyyy HH:mm)
ownerViewbooleanQuyền xem chủ sở hữu
domainNamestringTên miền gắn hosting
expireDatestringNgày hết hạn
renewTrialbooleanGia hạn dùng thử
serverNamestringURL server hosting panel
createdDatestringNgày tạo
onlyInSystembooleanChỉ 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ểuBắt buộcMô tả
domainIdpathintegerID 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

JSON
{
  "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ườngKiểuMô tả
idintegerID hosting
typestringLoại hosting
planIdintegerID gói hosting
statusstringTrạng thái: active, suspended, trial, expired
planNamestringTên gói hosting
roidTypestringLoại dịch vụ
serverIpstringIP server
trialDayintegerSố ngày dùng thử
issueDatestringNgày cấp (MM/dd/yyyy HH:mm)
ownerViewbooleanQuyền xem chủ sở hữu
domainNamestringTên miền gắn hosting
expireDatestringNgày hết hạn
serverNamestringURL server hosting panel
onlyInSystembooleanChỉ 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ểuBắt buộcMô tả
hostingIdpathintegerID hosting
targetIpquerystringIP 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

JSON
{
  "status": "example_status",
  "message": "Đã xóa IP bị deny"
}
TrườngKiểuMô tả
statusstringKết quả: success hoặc error
messagestringThô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ểuBắt buộcMô tả
hostingIdpathintegerID hosting
targetIpquerystringIP 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

JSON
{
  "result": {
    "denied": true,
    "targetIp": "example_targetIp"
  },
  "status": "example_status"
}
TrườngKiểuMô tả
resultobjectChi tiết kết quả
result.deniedbooleantrue = IP đang bị block, false = không bị block
result.targetIpstringIP được kiểm tra
statusstringKế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ểuBắt buộcMô tả
hostingIdpathintegerID 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

JSON
{
  "id": 1,
  "newPassword": "example_newPassword"
}
TrườngKiểuMô tả
idintegerID hosting
newPasswordstringMậ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ểuBắt buộcMô tả
hostingIdpathintegerID hosting

Request Body

TrườngKiểuBắt buộcMô tả
sshKeyNamestringTê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

JSON
{
  "id": 1
}
TrườngKiểuMô tả
idintegerID 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ểuBắt buộcMô tả
hostingIdpathintegerID hosting

Request Body

TrườngKiểuBắt buộcMô tả
notestringGhi chú
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/note"

Response

JSON
{
  "id": 1,
  "note": "example_note"
}
TrườngKiểuMô tả
idintegerID hosting
notestringGhi 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ểuBắt buộcMô tả
hostingIdpathintegerID hosting

Request Body

TrườngKiểuBắt buộcMô tả
domainNamestringTên domain mới
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/domain-name"

Response

JSON
{
  "id": 1,
  "status": "example_status",
  "domainName": "example_domainName"
}
TrườngKiểuMô tả
idintegerID hosting
statusstringTrạng thái hosting
domainNamestringTê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ểuBắt buộcMô tả
hostingIdpathintegerID hosting

Request Body

TrườngKiểuBắt buộcMô tả
addonDomainstringTên miền addon (VD: example.vn)
hostingAddonIpstringIP 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

JSON
{
  "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ườngKiểuMô tả
idintegerID hosting
statusstringTrạng thái hosting
planNamestringTên gói hosting
serverIpstringIP server
addonListarrayDanh sách addon domain sau khi thêm
addonList[].idintegerID addon
addonList[].ipstringIP addon
addonList[].hostingIdintegerID hosting
addonList[].subDomainstringSubdomain
addonList[].addonDomainstringTên miền addon
domainNamestringTên miền chính
serverNamestringURL 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ểuBắt buộcMô tả
hostingIdpathintegerID hosting
hostingAddonIdpathintegerID addon
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://developers-dev.inet.vn/api/gateway/v1/hosting/{hostingId}/addon/{hostingAddonId}"

Response

JSON
{
  "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ườngKiểuMô tả
idintegerID hosting
statusstringTrạng thái hosting
planNamestringTên gói hosting
serverIpstringIP server
addonListarrayDanh sách addon domain còn lại sau khi xóa
addonList[].idintegerID addon
addonList[].ipstringIP addon
addonList[].hostingIdintegerID hosting
addonList[].subDomainstringSubdomain
addonList[].addonDomainstringTên miền addon
domainNamestringTên miền chính
serverNamestringURL 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ểuBắt buộcMô tả
hostingIdpathintegerID 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

JSON
{
  "url": "example_url"
}
TrườngKiểuMô tả
urlstringURL đă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ểuBắt buộcMô tả
hostingIdpathintegerID 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

JSON
{
  "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ườngKiểuMô tả
idintegerID hosting
typestringLoại hosting (vd: seo-class-c)
planIdintegerID gói hosting
statusstringTrạng thái: active, trial, suspended, expired
planNamestringTên gói hosting (vd: Gói A)
serverIpstringIP server hosting
userNamestringUsername hosting
issueDatestringNgày kích hoạt (dd/MM/yyyy HH:mm)
domainNamestringTên miền chính của hosting
expireDatestringNgày hết hạn (dd/MM/yyyy HH:mm)
ownerEmailstringEmail chủ sở hữu
serverNamestringURL control panel server
lastChangePasswordstringLầ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ểuBắt buộcMô tả
hostingIdpathintegerID 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

JSON
{
  "id": 1,
  "status": "example_status"
}
TrườngKiểuMô tả
idintegerID hosting
statusstringTrạng thái sau khi restart: active, suspended, trial