TencentBlueKing / bk-cmdb

蓝鲸智云配置平台(BlueKing CMDB)
http://bk.tencent.com
Other
5.41k stars 1.58k forks source link

腾讯云资源同步信息太少 #7416

Open oldthreefeng opened 1 year ago

oldthreefeng commented 1 year ago

type Instance struct { InstanceId string json:"bk_cloud_inst_id" bson:"bk_cloud_inst_id" PrivateIp string json:"bk_host_innerip" bson:"bk_host_innerip" PublicIp string json:"bk_host_outerip" bson:"bk_host_outerip" InstanceState string json:"bk_cloud_host_status" bson:"bk_cloud_host_status" VpcId string json:"bk_vpc_id" bson:"bk_vpc_id" }

https://github.com/TencentBlueKing/bk-cmdb/blob/53fa5996b3ddff2ec8e9dba039452ce46ce26dca/src/scene_server/cloud_server/cloudvendor/tencent_cloud.go#L175C1-L181C6

腾讯云的实例信息这么多, 为啥才同步这几个信息呢? 搞不懂做这个的时候是什么心态。 这个有人在用吗?

仅吐槽。

oldthreefeng commented 1 year ago

举一个例子, 腾讯云返回的是信息如下, 有很多, 当时考虑为啥只有 5个值呢。 是不是可以考虑更多的

image
{
        "CPU": 164,
        "CamRoleName": "",
        "CreatedTime": "2023-09-20T02:08:20Z",
        "DataDisks": [],
        "DedicatedClusterId": "",
        "DefaultLoginPort": 22,
        "DefaultLoginUser": "ubuntu",
        "DisableApiTermination": false,
        "DisasterRecoverGroupId": "",
        "ExpiredTime": "2023-10-20T02:08:20Z",
        "GPUInfo": {
          "GPUCount": 8,
          "GPUId": [
            "0000:a5:00.0",
            "0000:cb:00.0",
            "0000:0e:00.0",
            "0000:4b:00.0",
            "0000:ab:00.0",
            "0000:d0:00.0",
            "0000:13:00.0",
            "0000:51:00.0"
          ],
          "GPUType": "NVIDIA A100"
        },
        "HpcClusterId": "",
        "IPv6Addresses": null,
        "ImageId": "img-74435w2x",
        "InstanceChargeType": "UNDERWRITE",
        "InstanceId": "ins-5axacm03",
        "InstanceName": "baichuan-01-8xa100",
        "InstanceState": "RUNNING",
        "InstanceType": "GT4.41XLARGE948",
        "InternetAccessible": {
          "BandwidthPackageId": null,
          "InternetChargeType": null,
          "InternetMaxBandwidthOut": 0,
          "PublicIpAssigned": null
        },
        "IsolatedSource": "NOTISOLATED",
        "LatestOperation": "ModifyInstancesAttribute.InstanceName",
        "LatestOperationErrorMsg": null,
        "LatestOperationRequestId": "fb----8",
        "LatestOperationState": "SUCCESS",
        "LicenseType": "TencentCloud",
        "LoginSettings": {
          "KeepImageLogin": null,
          "KeyIds": [
            "skey-4sqh98sf"
          ],
          "Password": null
        },
        "Memory": 948,
        "OsName": "Ubuntu Server 20.04 LTS 64位",
        "Placement": {
          "HostId": null,
          "HostIds": null,
          "ProjectId": 0,
          "Zone": "ap-shanghai-5"
        },
        "PrivateIpAddresses": [
          "10.122.19.44"
        ],
        "PublicIpAddresses": null,
        "RdmaIpAddresses": null,
        "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
        "RestrictState": "NORMAL",
        "SecurityGroupIds": [
          "sg-47---9c"
        ],
        "StopChargingMode": "NOT_APPLICABLE",
        "SystemDisk": {
          "CdcId": null,
          "DiskId": "disk-j9--h5",
          "DiskSize": 500,
          "DiskType": "CLOUD_HSSD"
        },
        "Tags": [],
        "Uuid": "ff00----6f",
        "VirtualPrivateCloud": {
          "AsVpcGateway": false,
          "Ipv6AddressCount": null,
          "PrivateIpAddresses": null,
          "SubnetId": "subnet-8---al",
          "VpcId": "vpc-3c---q"
        }
      }