You need to enable JavaScript to run this app.
导航

DescribeMigrationSources - 查询迁移源信息

最近更新时间2024.05.23 10:12:41

首次发布时间2023.07.18 10:22:41

调用 DescribeMigrationSources 接口,查询迁移源信息。

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

DescribeMigrationSources

要执行的操作,取值:DescribeMigrationSources。

Version
String

2020-04-01

API的版本,取值:2020-04-01。

Order
String

Desc

排序顺序,取值:

  • Desc:降序。
  • Asc:升序。
OrderByColumn
String

CreatedAt

排序字段,取值:

  • CreatedAt:导入时间。
PageNumber
Integer

1

分页数。

PageSize
Integer

10

页表大小。

  • 取值范围:1~50
  • 默认值:10
ProjectName
String

project_a

迁移源所属项目,一个迁移源只能归属于一个项目。

  • 只能包含字母、数字、下划线“_”、点“.”和中划线“-”。
  • 长度限制在64个字符以内。
SourceId
String

s-3tiegs1y963vj0******

迁移源ID,可在导入迁移源时或调用本接口查询获取。

说明

根据迁移源ID查询迁移源信息时,需要传入该参数。

SourceName
String

本地VM

迁移源名称,最大长度为255个字符。

说明

根据迁移源名称查询迁移源信息时,需要传入该参数。

SourceState
String

Online

迁移源状态,取值:

  • Online:在线。
  • Offline:离线。
  • Migrating:迁移中。
  • Error:异常。
SourceType
String

Normal

迁移源来源类型。取值:

  • Normal:普通迁移。
  • Batch:一键迁移。
TagFilters.N.Key
Array of String

TagFilters.1.Key=k1&Tags.2.Key=k2

根据标签查询资源时指定的标签键。

  • 参数 - N:表示标签键的序号,取值范围:1~10。
  • 多个标签键之间用&分隔,不允许重复。

说明

  • 不传则表示查询所有标签。
  • 传入空字符串时,则返回错误码InvalidTagFilterKey.Malformed
TagFilters.N.Values.N
Array of String

TagFilters.1.Values.1=v1&TagFilters.1.Values.2=v2

根据标签查询资源时指定的标签值。

  • 第一个N:表示标签键的序号,取值范围:1~10。
  • 第二个N:表示标签值的序号,取值范围:1~3。
  • 多个标签值之间用&分隔。

说明

  • 如果传入该参数,则必须先传入TagFilters.N.Key。
  • 不传则表示查询同一标签键下的所有标签值。
  • 传入空字符串时,表示查询标签值为空的标签。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
PageNumber
Integer

1

分页数。

PageSize
Integer

10

页表大小。

Sources
Array of SourcesForDescribeMigrationSources

--

符合条件的迁移源信息。

TotalCount
Integer

1

迁移源总数。

请求示例

GET /?Action=DescribeMigrationSources&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: smc

返回示例

{
  "ResponseMetadata": {
    "RequestId": "202306021637410F150D*****",
    "Action": "DescribeMigrationSources",
    "Version": "2020-04-01",
    "Service": "smc",
    "Region": "cn-beijing"
  },
  "Result": {
    "TotalCount": 1,
    "PageNumber": 1,
    "PageSize": 10,
    "Sources": [
      {
        "SourceId": "s-ycg9hd3nfb8rx6****",
        "SourceName": "s-ycg9hd3nfb8r****",
        "Hostname": "localhost.localdomain",
        "CreatedAt": "2023-06-01T10:27:16+08:00",
        "SourceState": "Migrating",
        "PublicIpAddress": "119.x.xxx.xxx",
        "PrivateIpAddress": "172.xx.xx.xxx",
        "AgentVersion": "linux-1.4",
        "ProjectName": "project_a",
        "SourceType": "Normal",
        "SystemInfo": {
          "CPU": 1,
          "Memory": 1019027456,
          "CPUUsage": 4,
          "MemoryUsage": 47.86,
          "Architecture": "x86_64"
        },
        "ImageInfo": {
          "OS": "Linux",
          "Platform": "CentOS",
          "PlatformVersion": "7.9.2009",
          "BootMode": "UEFI",
          "VirtualizationSystem": "",
          "KernelVersion": "3.10.0-1160.102.1.el7.x86_64"
        },
        "InstanceInfo": {
          "InnerInstance": "true",
          "InstanceId": "i-3teco18f1w5a71****",
          "RegionId": "cn-beijing",
          "Virtio11Install": true,
          "BlkNoneCanInstall": true
        },
        "DiskInfo": [
          {
            "DiskIndex": 0,
            "DiskSize": 20,
            "Partitions": [
              {
                "PartitionIndex": 0,
                "PartitionSize": 209715200,
                "Mountpoint": "/boot/efi",
                "FileSystemFormat": "vfat"
              },
              {
                "PartitionIndex": 1,
                "PartitionSize": 1073741824,
                "Mountpoint": "/boot",
                "FileSystemFormat": "xfs"
              }
            ],
            "FileSystemFormat": "",
            "DiskName": "vda",
            "IsSystemDisk": true
          }
        ],
        "Tags": [
          {
            "Key": "k1",
            "Value": "v1"
          }
        ],
        "LvmInfo": {
          "VgInfos": []
        },
        "LastMigrationJobInfo": {
          "DestinationType": "ECSInstance",
          "ProjectName": "project_a",
          "MigrationJobId": "job-ycg9hghuv7****",
          "MigrationJobName": "VMware迁移",
          "MigrationJobState": "Replicating"
        }
      }
    ]
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidOrder.Malformed
The specified Order is malformed.

指定的Order不合法。

400
InvalidOrderByColumn.Malformed
The specified OrderByColumn is malformed.

指定的OrderByColumn不合法。

400
InvalidProjectName.Malformed
The specified ProjectName is malformed.

指定的ProjectName不合法。

400
InvalidSourceName.Malformed
The specified SourceName is malformed.

指定的SourceName不合法。

400
InvalidSourceState.Malformed
The specified SourceState is malformed.

指定的SourceState不合法。

400
InvalidSourceType.Malformed
The specified SourceType is malformed.

指定的SourceType不合法。

400
InvalidTagFilterKey.Conflict
The specified TagFilterKey already exists.

指定的过滤标签键已存在。

400
InvalidTagFilterKey.Malformed
The specified TagFilterKey is malformed.

指定的标签键不合法。

400
InvalidTagFilterValue.Malformed
The specified TagFilterValue already exists.

指定的过滤标签值已存在。

400
LimitExceeded.MaximumTagFilterKeys
You've reached the limit on the number of TagFilterKeys that you can set.

指定的标签过滤键超过最大限制。

400
LimitExceeded.MaximumTagFilterResults
You've reached the limit on the number of resources that you can describe by TagFilters.

通过标签过滤出的资源数量超过上限。

400
LimitExceeded.MaximumTagFilterValues
You've reached the limit on the number of TagFilterValues that you can set.

指定的标签过滤值超过最大限制。