bannerAds
Global
language language

Product

Doc

Support

Menu 

SiliCloud Help Document Center

search

Popular search terms

通信格式 和 API 请求案例

Update time 2023-07-16 23:59  Version v2.0
I want feedback 
Collect My collection

一、通信格式

HTTP Header 说明
Content-Type application/json
request_id 请自行生成一个,16-64字符长度的追踪码
api_key 此数据,在您的页面中,格式例:1813993854851205831
signature signature=SHA-256(requestUrlPath + request_id + API_Secret_Key)

二、API 请求案例

数据罗列:
请求的API URL为:

https://api.silicloud.com/ncs-server/api/v1/host/search

开发者 API Key为:

1813998546851201024

开发者 API Secret Key为:

ipB3N04wnZ44aEk2L8AurlLsnf3yMugQ3Km1YWkc4SJ8ImRdk40Fz1ykAJkXQ80D

自定义的request_id:

2942183558593ffc9d75fb8e16793ff

需要SHA-256的原数据为:

/ncs-server/api/v1/host/search2942183558593ffc9d75fb8e16793ffipB3N04wnZ44aEk2L8AurlLsnf3yMugQ3Km1YWkc4SJ8ImRdk40Fz1ykAJkXQ80D

SHA-256 CLI 案例:

echo -n "/ncs-server/api/v1/host/search2942183558593ffc9d75fb8e16793ffipB3N04wnZ44aEk2L8AurlLsnf3yMugQ3Km1YWkc4SJ8ImRdk40Fz1ykAJkXQ80D" | sha256sum

SHA-256 后的结果:

3a37ac0c5be79cbfc5fa3382ec55c7534b9e93d2f70acd9f74d57f9700db4c6f

CURL CLI 案例:

curl -X GET -k "https://api.silicloud.com/ncs-server/api/v1/host/search" \
-H 'api_key: 1813998546851201024' \
-H 'Content-Type: application/json' \
-H 'request_id: 2942183558593ffc9d75fb8e16793ff' \
-H 'signature: 3a37ac0c5be79cbfc5fa3382ec55c7534b9e93d2f70acd9f74d57f9700db4c6f' \
-d '{"page": 1,"row": 5}' | python3 -m json.tool

CLI 输出 Json 案例:

{
    "status": 2000,
    "message": "success",
    "data": {
        "count": 5,
        "data": [
            {
                "userAccount": "3w5fuhgs2iqxz",
                "remoteId": "47f40b5a-5229-4774-bdef-715a9e00e390",
                "productId": "cvm.g2.intel.c2m4",
                "projectId": "0",
                "projectName": "\u9ed8\u8ba4",
                "latestOrderId": "1812785320597127170",
                "cpuNum": 2,
                "memSize": 4096,
                "systemDiskInfo": "{\"productId\":\"ssd_cloud_disk\",\"productName\":\"vSSD\",\"diskSize\":60,\"status\":\"OPENING\",\"isBootable\":true,\"imageInfo\":\"AlmaLinux-8-x86_64\",\"countSnapSize\":0.0,\"id\":\"disk-3525ku1gwnkhp\"}",
                "areaMark": "jp01",
                "areaName": "TYO-JP-1",
                "hostType": "General-2",
                "hostTypeName": "General-2",
                "floatIpId": "36848b20-12d7-4c76-8742-dd9f34fe8bfb",
                "floatIp": "10.66.88.123",
                "innerIp": "172.16.0.110",
                "ipV6": "2400:38bb:1:417b::143,2400:38bb:1:417b::158,2400:38bb:1:417b::1fd,2400:38bb:1:417b::2a9,2400:38bb:1:417b::2f3,2400:38bb:1:417b::39d,2400:38bb:1:417b::3cd,2400:38bb:1:417b::56",
                "bandwidthStatus": "OK",
                "imageId": "Ubuntu-22-x86_64",
                "imageName": "Ubuntu-22-x86_64",
                "imageType": "public",
                "securityGroupStatus": "ok",
                "securityGroupInfo": "d863ade4-91be-41b3-8217-704a4e793c9e",
                "beginTime": 1688287892539,
                "endTime": 1846140692539,
                "status": "OK",
                "remoteHostStatus": "ACTIVE",
                "buildStatus": "build_success",
                "bindDiskCount": 1,
                "hasBoot": true,
                "autoRenew": false,
                "supportNoReasonRefund": false,
                "refundStatus": "NONE",
                "remarks": "bat-robot-lab",
                "configuration": "{\"cpu_type\":\"Scalable 2nd\",\"intranet\":\"2.5 Gbps\",\"CPU_Frequency\":\"2.5 Ghz\",\"CPU_cores\":\"2\",\"RAM\":\"4 GiB\"}",
                "tempPass": "",
                "networkName": "vpc-3uavd2jfo9h53",
                "createTime": 1688287892539,
                "updateTime": 1689210034926,
                "checkTime": 1688374292539,
                "bandwidthPackageId": 44,
                "bandwidthPackageName": "global_v6only-500G",
                "bandwidthPackageTotalSize": 512000,
                "bandwidthPackageLimit": 500,
                "bandwidthPackageUsedSize": 33,
                "bandComputeType": 1,
                "fixedRenewHkPrice": 0,
                "fixRenewTime": "",
                "mixBand": true,
                "id": "cvm-3uavd2jfo9h53"
            },
            {
                "userAccount": "3w5fuhgs2iqxz",
                "remoteId": "37706fe9-57de-4e31-a5e4-15effe3d45e5",
                "productId": "cvm.g4.amd.c1m2",
                "projectId": "0",
                "projectName": "\u9ed8\u8ba4",
                "latestOrderId": "1812785221812879361",
                "cpuNum": 1,
                "memSize": 2048,
                "systemDiskInfo": "{\"productId\":\"ssd_cloud_disk\",\"productName\":\"vSSD\",\"diskSize\":25,\"status\":\"OPENING\",\"isBootable\":true,\"imageInfo\":\"CyberPanel-2.3-Ubuntu20\",\"countSnapSize\":0.0,\"id\":\"disk-3uavd2jfo9h53\"}",
                "areaMark": "jp01",
                "areaName": "TYO-JP-1",
                "hostType": "General-EPYC-4",
                "hostTypeName": "General-EPYC-4",
                "floatIpId": "0d146165-6bce-4899-9b4e-6fe0e15c2d5c",
                "floatIp": "154.19.186.123",
                "innerIp": "172.16.0.250",
                "ipV6": "2400:38bb:1:417b::111,2400:38bb:1:417b::195,2400:38bb:1:417b::1ba,2400:38bb:1:417b::210,2400:38bb:1:417b::27d,2400:38bb:1:417b::2fc,2400:38bb:1:417b::311,2400:38bb:1:417b::388",
                "bandwidthStatus": "OK",
                "imageId": "AlmaLinux-8-x86_64",
                "imageName": "AlmaLinux-8-x86_64",
                "imageType": "public",
                "securityGroupStatus": "ok",
                "securityGroupInfo": "sg-3db5dz82u0mzb,d0bdbf3b-a457-4e17-968e-f8416f38d125,",
                "beginTime": 1687710525198,
                "endTime": 1848155325198,
                "status": "OK",
                "remoteHostStatus": "ACTIVE",
                "buildStatus": "build_success",
                "bindDiskCount": 1,
                "hasBoot": true,
                "autoRenew": false,
                "supportNoReasonRefund": false,
                "refundStatus": "NONE",
                "remarks": "tyo-lg-cn2mixed",
                "configuration": "{\"cpu_type\":\"EPYC Roma\",\"intranet\":\"2.5 Gbps\",\"CPU_Frequency\":\"3.0Ghz\",\"CPU_cores\":\"1\",\"RAM\":\"2 GiB\"}",
                "tempPass": "",
                "networkName": "vpc-3j322f0q4ry0t",
                "createTime": 1687710525198,
                "updateTime": 1689515853078,
                "checkTime": 1687796925198,
                "bandwidthPackageId": 27,
                "bandwidthPackageName": "cn2_mixed-1T",
                "bandwidthPackageTotalSize": 1024000,
                "bandwidthPackageLimit": 1000,
                "bandwidthPackageUsedSize": 22653,
                "bandComputeType": 1,
                "fixedRenewHkPrice": 0,
                "fixRenewTime": "",
                "mixBand": true,
                "id": "cvm-3kbiutv25s224"
            },
            {
                "userAccount": "3w5fuhgs2iqxz",
                "remoteId": "fb25c579-1574-4878-8d4b-e8cf3adbd369",
                "productId": "cvm.g4.amd.c1m2",
                "projectId": "0",
                "projectName": "\u9ed8\u8ba4",
                "latestOrderId": "1812785205706752001",
                "cpuNum": 1,
                "memSize": 2048,
                "systemDiskInfo": "{\"productId\":\"ssd_cloud_disk\",\"diskSize\":25,\"remoteHostName\":\"computer01\",\"countSnapSize\":0.0,\"id\":\"disk-3kbhudf25s223\"}",
                "areaMark": "jp01",
                "areaName": "TYO-JP-1",
                "hostType": "General-EPYC-4",
                "hostTypeName": "General-EPYC-4",
                "floatIpId": "51693aab-6ef6-4fe7-90ef-fb511bc8f87e",
                "floatIp": "103.214.168.123",
                "innerIp": "172.16.0.185",
                "ipV6": "2400:38bb:1:417b::1a7,2400:38bb:1:417b::202,2400:38bb:1:417b::33,2400:38bb:1:417b::339,2400:38bb:1:417b::3b0,2400:38bb:1:417b::bf,2400:38bb:1:417b::df,2400:38bb:1:417b::e4",
                "bandwidthStatus": "OK",
                "imageId": "AlmaLinux-8-x86_64",
                "imageName": "AlmaLinux-8-x86_64",
                "imageType": "public",
                "securityGroupStatus": "ok",
                "securityGroupInfo": "sg-3db5dz82u0mzb,12cf43f9-e05f-4b2e-8273-4add71636b85,",
                "beginTime": 1687677294546,
                "endTime": 1848122094546,
                "status": "OK",
                "remoteHostStatus": "ACTIVE",
                "buildStatus": "build_success",
                "bindDiskCount": 1,
                "hasBoot": true,
                "autoRenew": false,
                "supportNoReasonRefund": false,
                "refundStatus": "NONE",
                "remarks": "tyo-lg-global",
                "configuration": "{\"cpu_type\":\"EPYC Roma\",\"intranet\":\"2.5 Gbps\",\"CPU_Frequency\":\"3.0Ghz\",\"CPU_cores\":\"1\",\"RAM\":\"2 GiB\"}",
                "tempPass": "",
                "networkName": "vpc-3j322f0q4ry0t",
                "createTime": 1687677294546,
                "updateTime": 1689515492976,
                "checkTime": 1687763694546,
                "bandwidthPackageId": 20,
                "bandwidthPackageName": "global-1T",
                "bandwidthPackageTotalSize": 1024000,
                "bandwidthPackageLimit": 500,
                "bandwidthPackageUsedSize": 24036,
                "bandComputeType": 1,
                "fixedRenewHkPrice": 0,
                "fixRenewTime": "",
                "mixBand": true,
                "id": "cvm-399ds0kxhxiq2"
            },
            {
                "userAccount": "3w5fuhgs2iqxz",
                "remoteId": "3121563f-9750-4aa0-9471-4508d87c8f32",
                "productId": "cvm.cx1.intel.c1m2",
                "projectId": "0",
                "projectName": "\u9ed8\u8ba4",
                "latestOrderId": "1779564685936820224",
                "cpuNum": 1,
                "memSize": 2048,
                "systemDiskInfo": "{\"productId\":\"ssd_cloud_disk\",\"productName\":\"ssd_cloud_disk\",\"diskSize\":40,\"status\":\"OPENING\",\"isBootable\":true,\"imageInfo\":\"Ubuntu-20-x86_64\",\"countSnapSize\":0.0,\"id\":\"disk-3jehjg725s223\"}",
                "areaMark": "us01",
                "areaName": "US-WEST-01",
                "hostType": "ComputeX-1",
                "hostTypeName": "ComputeX-1",
                "floatIpId": "690bfa7d-151c-4eb8-9a76-09e572d24c9d",
                "floatIp": "154.19.185.123",
                "innerIp": "172.16.0.135",
                "ipV6": "2400:38bb:0:4001::119,2400:38bb:0:4001::1ef,2400:38bb:0:4001::251,2400:38bb:0:4001::357,2400:38bb:0:4001::3c6,2400:38bb:0:4001::3dc,2400:38bb:0:4001::69,2400:38bb:0:4001::d0",
                "bandwidthStatus": "OK",
                "bandwidthProductId": "global",
                "bandwidthTypeName": "global",
                "bandwidth": 256,
                "imageId": "AlmaLinux-8-x86_64",
                "imageName": "AlmaLinux-8-x86_64",
                "imageType": "public",
                "securityGroupStatus": "ok",
                "securityGroupInfo": "sg-3kbuf3m23i222,",
                "beginTime": 1657259461374,
                "endTime": 1817704261374,
                "status": "OK",
                "remoteHostStatus": "ACTIVE",
                "buildStatus": "build_success",
                "bindDiskCount": 2,
                "hasBoot": true,
                "autoRenew": false,
                "autoRenewMonth": 1,
                "supportNoReasonRefund": false,
                "refundStatus": "NONE",
                "remarks": "lax-lg-global",
                "configuration": "{\"cpu_type\":\"Scalable 2nd\",\"intranet\":\"2.5 Gbps\",\"CPU_Frequency\":\"3.8 Ghz\",\"CPU_cores\":\"1\",\"RAM\":\"2 GiB\"}",
                "tempPass": "",
                "networkName": "vpc-35yceghk0jx4b",
                "createTime": 1657259461374,
                "updateTime": 1688488138311,
                "checkTime": 1657345861374,
                "bandComputeType": 1,
                "fixedRenewHkPrice": 0,
                "fixRenewTime": "",
                "mixBand": true,
                "id": "cvm-3imlt4lox3lb4"
            },
            {
                "userAccount": "3w5fuhgs2iqxz",
                "remoteId": "39b12f98-d817-4d71-a46c-a18c10e6b821",
                "productId": "cvm.cx1.intel.c1m2",
                "projectId": "0",
                "projectName": "\u9ed8\u8ba4",
                "latestOrderId": "1779483368249622529",
                "cpuNum": 1,
                "memSize": 2048,
                "systemDiskInfo": "{\"productId\":\"ssd_cloud_disk\",\"productName\":\"ssd_cloud_disk\",\"diskSize\":40,\"status\":\"OPENING\",\"isBootable\":true,\"imageInfo\":\"Ubuntu-22-x86_64\",\"countSnapSize\":0.0,\"id\":\"disk-3jdiwnr25s223\"}",
                "areaMark": "us01",
                "areaName": "US-WEST-01",
                "hostType": "ComputeX-1",
                "hostTypeName": "ComputeX-1",
                "floatIpId": "8543344e-8296-4489-b1f4-a088d8cef5b7",
                "floatIp": "103.177.81.123",
                "innerIp": "172.16.0.219",
                "ipV6": "2400:38bb:0:4001::159,2400:38bb:0:4001::257,2400:38bb:0:4001::26f,2400:38bb:0:4001::288,2400:38bb:0:4001::376,2400:38bb:0:4001::38f,2400:38bb:0:4001::3d5,2400:38bb:0:4001::42",
                "bandwidthStatus": "OK",
                "bandwidthProductId": "global-cn2mix",
                "bandwidthTypeName": "global-cn2mix",
                "bandwidth": 256,
                "imageId": "AlmaLinux-8-x86_64",
                "imageName": "AlmaLinux-8-x86_64",
                "imageType": "public",
                "securityGroupStatus": "ok",
                "securityGroupInfo": "sg-3kbuf3m23i222,",
                "beginTime": 1656255127786,
                "endTime": 1814021527786,
                "status": "OK",
                "remoteHostStatus": "ACTIVE",
                "buildStatus": "build_success",
                "bindDiskCount": 2,
                "hasBoot": true,
                "autoRenew": false,
                "autoRenewMonth": 1,
                "supportNoReasonRefund": false,
                "refundStatus": "NONE",
                "remarks": "lax-lg-cn2mixed",
                "configuration": "{\"cpu_type\":\"Scalable 2nd\",\"intranet\":\"2.5 Gbps\",\"CPU_Frequency\":\"3.8 Ghz\",\"CPU_cores\":\"1\",\"RAM\":\"2 GiB\"}",
                "tempPass": "",
                "networkName": "vpc-35yceghk0jx4b",
                "createTime": 1656255127786,
                "updateTime": 1688488144142,
                "checkTime": 1656341527786,
                "limitBand": "",
                "bandComputeType": 1,
                "fixedRenewHkPrice": 0,
                "fixRenewTime": "",
                "mixBand": true,
                "id": "cvm-3b2payh70f3of"
            }
        ]
    }
}

Do you have any suggestions for this document?

Your rating for this document