5.4.3 クエリパラメータの指定例
クエリパラメータの指定例と実行結果の出力例を示します。
クエリパラメータの指定例
クエリパラメータの指定例を次に示します。
- 複数のリソースの情報を取得するAPIでの$queryの指定例(lun-pathsの例)
-
?$query=hostGroup.portId eq 'CL1-A'&$query=ldev.storageDeviceId eq '800000010051'
- 複数のリソースの情報を取得するAPIでの$order-byの指定例(lun-pathsの例)
-
?$order-by=hostGroup.portId DESC,ldev.ldevId DESC&$query=ldev.storageDeviceId eq '800000010051'
- $queryの括弧付き条件の指定例($query=(<条件式>))
-
?$query=(ldev.storageDeviceId eq '800000010051')
- $queryでの複数の条件式を連結する指定例(<条件式> and <条件式>)
-
?$query=ldev.isDefined eq true and ldev.storageDeviceId eq '800000010051'
- $queryのboolean型の属性に対する指定例
-
?$query=ldev.isDefined eq false&$query=ldev.storageDeviceId eq '800000010051'
- $queryの数値型の属性に対する指定例(compare-expression)
-
?$query=ldev.poolId eq 1&$query=ldev.storageDeviceId eq '800000010051'
?$query=pool.virtualVolumeCapacityRate lt 0&$query=pool.storageDeviceId eq '800000010051'
- $queryのstring型の属性に対する指定例(compare-expression)
-
?$query=ldev.storageDeviceId eq '800000010051'
- $queryの数値型の属性に対する指定例(tuple-expression)
-
?$query=hostGroup.hostModeOptions contains [1,2]&?$query=hostGroup.storageDeviceId eq '800000010051'
- $queryのstring型の属性に対する指定例(tuple-expression)
-
?$query=ldev.attributes contains ['CVS','POOL']&$query=ldev.storageDeviceId eq '800000010051'
- $queryのstartsWith演算子の指定例($query=<属性名(非array型)> startsWith <値>)
-
?$query=ldev.emulationType startsWith 'OPEN-V'&$query=ldev.storageDeviceId eq '800000010051'
- $queryのcontains演算子の指定例($query=<属性名(array型)> contains [<値1>,<値2>...])
-
?$query=ldev.attributes contains ['CVS','POOL']&$query=ldev.storageDeviceId eq '800000010051'
- $queryのin演算子の指定例($query=<属性名(非array型)> in [<値1>,<値2>...])
-
?$query=ldev.emulationType in ['OPEN-V-CVS','OPEN-V-CVS-CM']&$query=ldev.storageDeviceId eq '800000010051'
実行結果の出力例
LUパス情報を取得する場合の出力例を示します。- リクエストURL
-
curl -v -H "Accept:application/json" -H "Authorization:Session b74777a3-f9f0-4ea8-bd8f-09847fac48d3" -X GET https://192.0.2.100:23451/ConfigurationManager/v1/views/lun-paths?$query=ldev.storageDeviceId%20eq%20'800000010051'
- 取得結果
-
{ "data" : [ { "hostGroup" : { "hostGroupId" : "CL1-A,0", "portId" : "CL1-A", "hostGroupNumber" : 0, "hostGroupName" : "1A-G001", "hostMode" : "WIN", "storageDeviceId" : "800000010051" }, "ldev" : { "ldevId" : 359, "clprId" : 0, "emulationType" : "OPEN-V-CVS", "byteFormatCapacity" : "1.00 G", "blockCapacity" : 2097152, "attributes" : [ "CVS" ], "status" : "NML", "mpBladeId" : 4, "poolId" : 11, "numOfUsedBlock" : 0, "isFullAllocationEnabled" : false, "storageDeviceId" : "800000010051", "isDefined" : true }, "lun" : { "lunId" : "CL1-A,0,0", "storageDeviceId" : "800000010051" } }, { "hostGroup" : { ... }, ... }, ... ], "offset" : 0, "count" : 100, "totalCount" : 961 }