调用DescribeSourceServers查询一个或多个迁移源信息。
接口说明
请求参数的作用类似于一个过滤器,过滤器为逻辑与(AND)关系。如果某一参数为空,则过滤器不起作用。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | DescribeSourceServers | 系统规定参数。取值:DescribeSourceServers。 |
| JobId | String | 否 | j-bp19vlwm0tyigbmj**** | 迁移任务ID。 |
| State | String | 否 | Available | 迁移源状态。取值范围:
|
| Name | String | 否 | testSourceServerName | 迁移源名称。长度为2~128个英文或中文字符。必须以大小写字母或中文开头,不能以http://和https://开头。可以包含数字、半角冒号(:)、下划线(_)或者连字符(-)。 默认值:空 |
| PageNumber | Integer | 否 | 1 | 返回的迁移源列表的页码。起始值:1。 默认值:1。 |
| PageSize | Integer | 否 | 10 | 分页查询时设置的每页行数。最大值:50。 默认值:10。 |
| SourceId.N | String | 否 | s-bp1e2fsl57knvuug**** | 迁移源ID,可以输入多个。 |
| ResourceGroupId | String | 否 | rg-acfmw3ty5y7**** | 资源组ID。 |
| Tag.N.Key | String | 否 | TestKey | 为SMC资源指定的标签键。N的取值范围:1~20 一旦传入该值,则不允许为空字符串。最多支持64个字符,不能以aliyun和acs:开头,不能包含http://或者https://。 |
| Tag.N.Value | String | 否 | TestValue | 为SMC资源指定的标签值。N的取值范围:1~20。 一旦传入该值,可以为空字符串。最多支持64个字符,不能包含http://或者https://。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| SourceServers | Array of SourceServer | 迁移源数组。 |
|
| SourceServer | |||
| CreationTime | String | 2019-06-27T02:58:09Z | 迁移源的注册时间。 |
| HeartbeatRate | Integer | 30 | SMC客户端(SMC Agent)心跳频率。单位:秒。 |
| State | String | InUse | 迁移源状态。 |
| DataDisks | Array of DataDisk | 迁移源的数据盘数组。 |
|
| DataDisk | |||
| Index | Integer | 1 | 数据盘顺序。 |
| Size | Integer | 20 | 数据盘N大小。单位:GiB。 |
| Parts | Array of Part | 数据盘分区信息。 |
|
| Part | |||
| CanBlock | Boolean | false | 数据盘分区是否支持块复制。 |
| SizeBytes | Long | 21474836480 | 数据盘分区大小。单位:Byte。 |
| Need | Boolean | false | 数据盘分区是否必须选择。 |
| Device | String | 1_0 | 数据盘分区设备标识。 |
| Path | String | /home/data | 数据盘分区路径。 |
| Path | String | /home/data | 数据盘N路径。 |
| SystemDiskParts | Array of SystemDiskPart | 系统盘分区信息。 |
|
| SystemDiskPart | |||
| CanBlock | Boolean | true | 系统盘分区是否支持块复制。 |
| SizeBytes | Long | 254803968 | 系统盘分区大小。单位:Byte。 |
| Need | Boolean | true | 系统盘分区是否必须选择。 |
| Device | String | 0_0 | 系统盘分区设备标识符。 |
| Path | String | /boot | 系统盘分区路径。 |
| KernelLevel | Integer | 1 | 内核版本级别。 |
| SourceId | String | s-bp1e2fsl57knvuug**** | 迁移源ID。 |
| AgentVersion | String | 1.5.2.3 | SMC客户端版本号。 |
| StatusInfo | String | {"error_code": "S1", "error_msg": "Rsync not found. Please install rsync."} | 迁移源状态详细信息。该参数在迁移源状态为异常时返回。JSON格式键值对,如:
|
| SystemDiskSize | Integer | 40 | 迁移源的系统盘大小。单位:GiB |
| Description | String | Server Source Imported By GotoAliyun. | 迁移源描述。 |
| ErrorCode | String | SourceServer.Offline | 迁移源状态错误码。 |
| JobId | String | j-bp19vlwm0tyigbmj**** | 最近一次的迁移任务ID。 |
| Platform | String | OpenSUSE | 迁移源的系统平台。 |
| ReplicationDriver | String | SMT | 复制驱动器。默认值:SMT(迁云工具) |
| Name | String | SourceServerName | 迁移源的名称。 |
| SystemInfo | String | {\"agent_mode\":\"daemon\",\"agent_type\":\"aliyun\",\"client_type\":\"\",\"cores\":\"2\",\"cpu_usage\":\"0.00\",\"hostname\":\"ixxxxxxxxxx\",\"ipv4\":\"10.0.0.1\",\"memory\":\"8.00\",\"memory_usage\":\"3.61\"} | 迁移源系统信息。JSON格式键值对,可扩展,键值固定。大小不超过1 KB。如:
|
| Architecture | String | x86_64 | 迁移源的系统架构。 |
| ResourceGroupId | String | rg-acfmw3ty5y7**** | 资源组ID。 |
| Tags | Array of Tag | 标签信息。 |
|
| Tag | |||
| Key | String | TestKey | 为SMC资源指定的标签键。N的取值范围:1~20。 一旦传入该值,则不允许为空字符串。最多支持64个字符,不能以aliyun和acs:开头,不能包含http://或者https://。 |
| Value | String | TestValue | 为SMC资源指定的标签值。N的取值范围:1~20。 一旦传入该值,可以为空字符串。最多支持64个字符,不能包含http://或者https://。 |
| TotalCount | Integer | 1 | 迁移源总数。 |
| PageSize | Integer | 10 | 每页行数。 |
| RequestId | String | 410E6073-66D0-45D3-AB3E-4DC3F5E4**** | 请求ID。 |
| PageNumber | Integer | 1 | 迁移源列表的页码。 |
示例
请求示例
http(s)://smc.aliyuncs.com/?Action=DescribeSourceServers
&JobId=j-bp19vlwm0tyigbmj****
&State=Available
&Name=testSourceServerName
&PageNumber=1
&PageSize=10
&SourceId=["s-bp1e2fsl57knvuug****"]
&ResourceGroupId=rg-acfmw3ty5y7****
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&公共请求参数
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeSourceServersResponse>
<SourceServers>
<CreationTime>2019-06-27T02:58:09Z</CreationTime>
<HeartbeatRate>30</HeartbeatRate>
<State>InUse</State>
<DataDisks>
<Index>1</Index>
<Size>20</Size>
<Parts>
<CanBlock>false</CanBlock>
<SizeBytes>21474836480</SizeBytes>
<Need>false</Need>
<Device>1_0</Device>
<Path>/home/data</Path>
</Parts>
<Path>/home/data</Path>
</DataDisks>
<SystemDiskParts>
<CanBlock>true</CanBlock>
<SizeBytes>254803968</SizeBytes>
<Need>true</Need>
<Device>0_0</Device>
<Path>/boot</Path>
</SystemDiskParts>
<KernelLevel>1</KernelLevel>
<SourceId>s-bp1e2fsl57knvuug****</SourceId>
<AgentVersion>1.5.2.3</AgentVersion>
<StatusInfo>{"error_code": "S1", "error_msg": "Rsync not found. Please install rsync."}</StatusInfo>
<SystemDiskSize>40</SystemDiskSize>
<Description>Server Source Imported By GotoAliyun.</Description>
<ErrorCode>SourceServer.Offline</ErrorCode>
<JobId>j-bp19vlwm0tyigbmj****</JobId>
<Platform>OpenSUSE</Platform>
<ReplicationDriver>SMT</ReplicationDriver>
<Name>SourceServerName</Name>
<SystemInfo>{\"agent_mode\":\"daemon\",\"agent_type\":\"aliyun\",\"client_type\":\"\",\"cores\":\"2\",\"cpu_usage\":\"0.00\",\"hostname\":\"ixxxxxxxxxx\",\"ipv4\":\"10.0.0.1\",\"memory\":\"8.00\",\"memory_usage\":\"3.61\"}</SystemInfo>
<Architecture>x86_64</Architecture>
<ResourceGroupId>rg-acfmw3ty5y7****</ResourceGroupId>
<Tags>
<Key>TestKey</Key>
<Value>TestValue</Value>
</Tags>
</SourceServers>
<TotalCount>1</TotalCount>
<PageSize>10</PageSize>
<RequestId>410E6073-66D0-45D3-AB3E-4DC3F5E4****</RequestId>
<PageNumber>1</PageNumber>
</DescribeSourceServersResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"SourceServers" : [ {
"CreationTime" : "2019-06-27T02:58:09Z",
"HeartbeatRate" : 30,
"State" : "InUse",
"DataDisks" : [ {
"Index" : 1,
"Size" : 20,
"Parts" : [ {
"CanBlock" : false,
"SizeBytes" : 21474836480,
"Need" : false,
"Device" : "1_0",
"Path" : "/home/data"
} ],
"Path" : "/home/data"
} ],
"SystemDiskParts" : [ {
"CanBlock" : true,
"SizeBytes" : 254803968,
"Need" : true,
"Device" : "0_0",
"Path" : "/boot"
} ],
"KernelLevel" : 1,
"SourceId" : "s-bp1e2fsl57knvuug****",
"AgentVersion" : "1.5.2.3",
"StatusInfo" : "{\"error_code\": \"S1\", \"error_msg\": \"Rsync not found. Please install rsync.\"}",
"SystemDiskSize" : 40,
"Description" : "Server Source Imported By GotoAliyun.",
"ErrorCode" : "SourceServer.Offline",
"JobId" : "j-bp19vlwm0tyigbmj****",
"Platform" : "OpenSUSE",
"ReplicationDriver" : "SMT",
"Name" : "SourceServerName",
"SystemInfo" : "{\\\"agent_mode\\\":\\\"daemon\\\",\\\"agent_type\\\":\\\"aliyun\\\",\\\"client_type\\\":\\\"\\\",\\\"cores\\\":\\\"2\\\",\\\"cpu_usage\\\":\\\"0.00\\\",\\\"hostname\\\":\\\"ixxxxxxxxxx\\\",\\\"ipv4\\\":\\\"10.0.0.1\\\",\\\"memory\\\":\\\"8.00\\\",\\\"memory_usage\\\":\\\"3.61\\\"}",
"Architecture" : "x86_64",
"ResourceGroupId" : "rg-acfmw3ty5y7****",
"Tags" : [ {
"Key" : "TestKey",
"Value" : "TestValue"
} ]
} ],
"TotalCount" : 1,
"PageSize" : 10,
"RequestId" : "410E6073-66D0-45D3-AB3E-4DC3F5E4****",
"PageNumber" : 1
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 403 | Forbidden.Unauthorized | A required authorization for the specified action is not supplied. | 用户未授权操作指定的资源。 |
| 500 | InternalError | An error occurred while processing your request. Please try again. If the problem still exists, please submit a ticket. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |
访问错误中心查看更多错误码。