调用SearchInventory查询配置清单的详细信息或聚合信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String SearchInventory

系统规定参数。取值:SearchInventory。

RegionId String cn-hangzhou

地域ID。

Filter.N.Name String ACS:InstanceInformation.InstanceId

组件的属性名称(N取值范围1-5)。不同的组件内部属性的名称不同。使用GetInventorySchema查询不同组件的属性名称。例如:组件ACS:InstanceInformation下有InstanceId这个属性,所以本参数则取值为ACS:InstanceInformation.InstanceId。

Filter.N.Operator String Equal

组件属性查询值比较符(N取值范围1-5)。

取值范围:

  • Equal
  • NotEqual
  • BeginWith
  • LessThan
  • GreaterThan
Filter.N.Value.N RepeatList i-bp1cpoxxxxxxxxxxxxxx

组件属性查询值(第一个N的取值范围为1-5,第二个N的取值范围为1-20)。

Aggregator.N RepeatList ACS:Application.Name

聚合器。可以使用一个或多个聚合器查询实例聚合信息。

取值范围:

  • ACS:Application.Name
  • ACS:Application.Version
NextToken String gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC

翻页标记的Token。

MaxResults Integer 50

分页大小。取值范围:1-100。默认为50。

返回数据

名称 类型 示例值 描述
Entities List [ { "ACS:InstanceInformation": { "CaptureTime": "2020-10-13T08:55:06Z", "SchemaVersion": "1.0", "Content": { "PlatformName": "ubuntu", "PlatformVersion": "20.04", "Status": "Running", "InstanceId": "i-bp1cpoxxxxxxxxxxxxxx", "AgentVersion": "v1.5", "ComputerName": "iZbp1cpoxxxw111jcv94drZ", "IpAddress": "192.168.10.245", "AgentName": "oosutil", "PlatformType": "linux" }, "RegionId": "cn-hangzhou" }, "Id": "i-bp1cpoxxxxxxxxxxxxxx" } ]}

组件查询的详细配置清单,或聚合信息。

MaxResults Integer 50

分页大小

NextToken String gAAAAABfTgv5ewUWmNdJ3g7JVLvX70sPH90GZOVGC

翻页标记的Token

RequestId String A81E4B2E-6B33-4BAE-9856-55DB7C893E01

请求ID

示例

请求示例

http(s)://[Endpoint]/?Action=SearchInventory
&Filter.0.Name=ACS:InstanceInformation.InstanceId
&Filter.0.Operator=Equal
&Filter.0.Value.0=i-bp1cpoxxxxxxxxxxxxxx
&Aggregator.0=ACS:Application.Name
&Aggregator.1=ACS:Application.Version
&<公共请求参数>

正常返回示例

XML 格式

<RequestId>5B694097-E7C7-4231-858C-B979CEC3A0AC</RequestId>
<MaxResults>50</MaxResults>
<Entities>
    <Data>
        <ACS:Application>
            <Content>
                <ACS:Application.Name>NetworkManager</ACS:Application.Name>
                <ACS:Application.Version>1.22.8</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>NetworkManager-libnm</ACS:Application.Name>
                <ACS:Application.Version>1.22.8</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>NetworkManager-team</ACS:Application.Name>
                <ACS:Application.Version>1.22.8</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>NetworkManager-tui</ACS:Application.Name>
                <ACS:Application.Version>1.22.8</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>PackageKit</ACS:Application.Name>
                <ACS:Application.Version>1.1.12</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>PackageKit-glib</ACS:Application.Name>
                <ACS:Application.Version>1.1.12</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>abattis-cantarell-fonts</ACS:Application.Name>
                <ACS:Application.Version>0.0.25</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>acl</ACS:Application.Name>
                <ACS:Application.Version>2.2.53</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>adcli</ACS:Application.Name>
                <ACS:Application.Version>0.8.2</ACS:Application.Version>
                <Count>1</Count>
            </Content>
            <Content>
                <ACS:Application.Name>aliyun_assist</ACS:Application.Name>
                <ACS:Application.Version>1.0.2.493</ACS:Application.Version>
                <Count>1</Count>
            </Content>
        </ACS:Application>
    </Data>
</Entities>

JSON 格式

{
	"RequestId": "5B694097-E7C7-4231-858C-B979CEC3A0AC",
	"MaxResults": 50,
	"Entities": [
		{
			"Data": {
				"ACS:Application": {
					"Content": [
						{
							"ACS:Application.Name": "NetworkManager",
							"ACS:Application.Version": "1.22.8",
							"Count": 1
						},
						{
							"ACS:Application.Name": "NetworkManager-libnm",
							"ACS:Application.Version": "1.22.8",
							"Count": 1
						},
						{
							"ACS:Application.Name": "NetworkManager-team",
							"ACS:Application.Version": "1.22.8",
							"Count": 1
						},
						{
							"ACS:Application.Name": "NetworkManager-tui",
							"ACS:Application.Version": "1.22.8",
							"Count": 1
						},
						{
							"ACS:Application.Name": "PackageKit",
							"ACS:Application.Version": "1.1.12",
							"Count": 1
						},
						{
							"ACS:Application.Name": "PackageKit-glib",
							"ACS:Application.Version": "1.1.12",
							"Count": 1
						},
						{
							"ACS:Application.Name": "abattis-cantarell-fonts",
							"ACS:Application.Version": "0.0.25",
							"Count": 1
						},
						{
							"ACS:Application.Name": "acl",
							"ACS:Application.Version": "2.2.53",
							"Count": 1
						},
						{
							"ACS:Application.Name": "adcli",
							"ACS:Application.Version": "0.8.2",
							"Count": 1
						},
						{
							"ACS:Application.Name": "aliyun_assist",
							"ACS:Application.Version": "1.0.2.493",
							"Count": 1
						}
					]
				}
			}
		}
	]
}

错误码

访问错误中心查看更多错误码。