Skip to content

Commit e0d0eac

Browse files
authored
Merge pull request #55 from andreirogobete/users/arogobet/update-apm-service-api-documentation
Update Asset Management Service HTTP API Documentation
2 parents 5f08c8c + 6eb79c1 commit e0d0eac

File tree

1 file changed

+251
-1
lines changed

1 file changed

+251
-1
lines changed

asset-managment/niapm.yml

Lines changed: 251 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ definitions:
9595
- writeAssets: Write information related to assets.
9696
9797
- deleteAssets: Delete information related to assets.
98+
99+
- readAssetUtilization: Read information related to asset utilization.
98100
type: object
99101
properties:
100102
readAssets:
@@ -103,6 +105,8 @@ definitions:
103105
$ref: '#/definitions/Operation'
104106
deleteAssets:
105107
$ref: '#/definitions/Operation'
108+
readAssetUtilization:
109+
$ref: '#/definitions/Operation'
106110
BusType:
107111
title: Bus Type
108112
description: All supported bus types for an asset.
@@ -404,6 +408,10 @@ definitions:
404408
description: Whether this asset is an NI asset (true) or a third-party asset (false).
405409
type: boolean
406410
example: true
411+
isSystemController:
412+
description: Whether this asset represents a System Controller.
413+
type: boolean
414+
example: true
407415
properties:
408416
description: Key-value-pair metadata associated with an asset.
409417
type: object
@@ -716,7 +724,7 @@ parameters:
716724
717725
- Contains operator '.Contains()', used to check whether a string contains another string. Example: 'x.Contains(y)'
718726
719-
- Not Contains operator '!.Contains()', used to check whether a string does not contain another string. Example: '!x.Contains(y)'
727+
- Does not contain operator '!.Contains()', used to check whether a string does not contain another string. Example: '!x.Contains(y)'
720728
721729
722730
Valid asset properties that can be used in the filter:
@@ -797,6 +805,174 @@ parameters:
797805
description: The request to update properties of the current service policy.
798806
schema:
799807
$ref: '#/definitions/ServicePolicy'
808+
QueryAssetUtilizationRequest:
809+
in: body
810+
name: queryAssetUtilizationRequestBody
811+
description: Request body consisting of filters for asset utilization, assets, and time intervals.
812+
schema:
813+
title: Query Asset Utilizations Request
814+
description: Object containing filters for asset utilization, assets, and time intervals.
815+
type: object
816+
required:
817+
- utilizationIntervals
818+
properties:
819+
utilizationFilter:
820+
description: >-
821+
The filter criteria for asset utilization. Consists of a string of queries composed using AND/OR operators.
822+
String values and date strings need to be enclosed in double quotes.
823+
Parenthesis can be used around filters to better define the order of operations.
824+
825+
Filter syntax: '[property name][operator][operand] and [property name][operator][operand]'
826+
827+
828+
Operators:
829+
830+
- Equals operator '='. Example: 'x = y'
831+
832+
- Not equal operator '!='. Example: 'x != y'
833+
834+
- Greater than operator '>'. Example: 'x > y'
835+
836+
- Greater than or equal operator '>='. Example: 'x >= y'
837+
838+
- Less than operator '<'. Example: 'x < y'
839+
840+
- Less than or equal operator '<='. Example: 'x <= y'
841+
842+
- Logical AND operator 'and'. Example: 'x and y'
843+
844+
- Logical OR operator 'or'. Example: 'x or y'
845+
846+
- Contains operator '.Contains()', used to check whether a string contains another string. Example: 'x.Contains(y)'
847+
848+
- Does not contain operator '!.Contains()', used to check whether a string does not contain another string. Example: '!x.Contains(y)'
849+
850+
851+
Valid asset utilization properties that can be used in the filter:
852+
853+
- AssetIdentifier: String representing the unique identifier of an asset.
854+
855+
- MinionId: String representing the identifier of a minion in which an asset might be located in.
856+
857+
- UtilizationCategory: String representing the utilization task category.
858+
859+
- User: : String representing the name of the operator who utilized the asset.
860+
type: string
861+
example: UtilizationCategory = "Test"
862+
assetFilter:
863+
description: >-
864+
The filter criteria for assets. Consists of a string of queries composed using AND/OR operators.
865+
String values and date strings need to be enclosed in double quotes.
866+
Parenthesis can be used around filters to better define the order of operations.
867+
868+
Filter syntax: '[property name][operator][operand] and [property name][operator][operand]'
869+
870+
871+
Operators:
872+
873+
- Equals operator '='. Example: 'x = y'
874+
875+
- Not equal operator '!='. Example: 'x != y'
876+
877+
- Greater than operator '>'. Example: 'x > y'
878+
879+
- Greater than or equal operator '>='. Example: 'x >= y'
880+
881+
- Less than operator '<'. Example: 'x < y'
882+
883+
- Less than or equal operator '<='. Example: 'x <= y'
884+
885+
- Logical AND operator 'and'. Example: 'x and y'
886+
887+
- Logical OR operator 'or'. Example: 'x or y'
888+
889+
- Contains operator '.Contains()', used to check whether a string contains another string. Example: 'x.Contains(y)'
890+
891+
- Does not contain operator '!.Contains()', used to check whether a string does not contain another string. Example: '!x.Contains(y)'
892+
893+
894+
Valid asset properties that can be used in the filter:
895+
896+
- AssetIdentifier: String representing the unique identifier of an asset.
897+
898+
- AssetClass: String enumeration representing the class of an asset. Possible values are: UNDEFINED, DISCOVERED, ASSET, DUT, FIXTURE.
899+
900+
- SerialNumber: String representing the serial number of an asset.
901+
902+
- ModelName: String representing the model name of an asset.
903+
904+
- ModelNumber: Unsigned integer representing the model number of an asset.
905+
906+
- VendorName: String representing the vendor name of an asset.
907+
908+
- VendorNumber: Unsigned integer representing the vendor number of an asset.
909+
910+
- AssetName: String representing the asset name.
911+
912+
- FirmwareVersion: String representing the firmware version of an asset.
913+
914+
- HardwareVersion: String representing the hardware version of an asset.
915+
916+
- BusType: String enumeration representing the bus type of an asset. Possible values are: BUILT_IN_SYSTEM, PCI_PXI, USB, GPIB, VXI, SERIAL, TCP_IP, CRIO, SCXI, CDAQ, SWITCH_BLOCK, SCC, FIRE_WIRE, ACCESSORY, CAN, SWITCH_BLOCK_DEVICE.
917+
918+
- IsNIAsset: Boolean flag specifying whether the asset is an NI asset or a third-party asset.
919+
920+
- Keywords: Collection of string values representing asset metadata keywords. Example: 'Keywords=["keyword1", "keyword2"]'.
921+
922+
- Properties: Collection of key-value pairs, each key-value pair representing an asset metadata property. Example: 'Properties=["key1":"value1", "key2":"value2"]'.
923+
924+
- Location.MinionId: String representing the identifier of the minion in which the asset is located in.
925+
926+
- Location.SystemName: String representing the name of the system that the asset is located in.
927+
928+
- Location.SlotNumber: Unsigned integer representing the slot number the asset is located in.
929+
930+
- Location.AssetState.SystemConnection: String enumeration representing the connection state of the system the asset is currently located in. Possible values are: APPROVED, DISCONNECTED, CONNECTED_UPDATE_PENDING, CONNECTED_UPDATE_SUCCESSFUL, CONNECTED_UPDATE_FAILED, UNSUPPORTED, ACTIVATED.
931+
932+
- Location.AssetState.AssetPresence: String enumeration representing the present status of an asset in a system. Possible values are: INITIALIZING, UNKNOWN, NOT_PRESENT, PRESENT.
933+
934+
- SupportsSelfCalibration: Boolean flag specifying whether the asset supports self-calibration.
935+
936+
- SelfCalibration.CalibrationDate: ISO-8601 formatted timestamp string specifying the last date the asset was self-calibrated. Example: "2018-05-20T00:00:00Z"
937+
938+
- SupportsExternalCalibration: Boolean flag specifying whether the asset supports external calibration.
939+
940+
- ExternalCalibration.CalibrationDate: ISO-8601 formatted timestamp string specifying the last date the asset was externally-calibrated. Example: "2018-05-20T00:00:00Z"
941+
942+
- ExternalCalibration.NextRecommendedDate: ISO-8601 formatted timestamp string specifying the recommended date for the next external calibration. Example: "2018-05-20T00:00:00Z"
943+
944+
- ExternalCalibration.RecommendedInterval: Integer representing the manufacturer-recommended calibration interval, in months.
945+
946+
- ExternalCalibration.Comments: String representing any external calibration comments.
947+
948+
- ExternalCalibration.IsLimited: Boolean flag specifying whether the last external calibration was a limited calibration.
949+
950+
- ExternalCalibration.Operator.DisplayName: String representing the name of the operator which performed an external calibration on a third-party asset.
951+
type: string
952+
example: AssetName = "APMPXI1Slot3" and ExternalCalibration.NextRecommendedDate > "2018-05-01T00:00:00.519Z"
953+
utilizationIntervals:
954+
description: Multiple time intervals for which to retrieve asset utilization.
955+
type: array
956+
items:
957+
title: Utilization Time Interval
958+
type: object
959+
properties:
960+
startDate:
961+
description: >-
962+
A date time value which can be used to specify the beginning of a timespan.
963+
964+
This parameter is required to have the "ISO 8601" format in order to be considered valid.
965+
type: string
966+
format: iso-date-time
967+
example: '2019-05-01T00:00:00.519Z'
968+
endDate:
969+
description: >-
970+
A date time value which can be used to specify the end of a timespan.
971+
972+
This parameter is required to have the "ISO 8601" format in order to be considered valid.
973+
type: string
974+
format: iso-date-time
975+
example: '2019-05-20T00:00:00Z'
800976
responses:
801977
Error:
802978
description: Error
@@ -957,6 +1133,59 @@ responses:
9571133
description: Service policy response containing the service calibration policy with the number of days for an asset to be considered as approaching calibration.
9581134
schema:
9591135
$ref: '#/definitions/ServicePolicy'
1136+
AssetUtilizationResponse:
1137+
description: Asset Utilization response containing the collection of utilizations matching the provided filters, in a specific time interval. Besides a time interval, each element contains an asset identifier, an asset utilization category, and a percentage of time that the asset was utilized in the time interval.
1138+
schema:
1139+
title: Asset Utilization Response
1140+
description: Response for the asset utilization query containing the collection of utilizations. Besides a time interval, each element contains an asset identifier, an asset utilization category, and a percentage of time that the asset was utilized in the time interval.
1141+
type: array
1142+
items:
1143+
type: object
1144+
required:
1145+
- startDate
1146+
- endDate
1147+
- assetIdentifier
1148+
- minionIdentifier
1149+
- utilizationCategory
1150+
- percentage
1151+
properties:
1152+
startDate:
1153+
description: >-
1154+
A date time value representing the beginning of an asset utilization interval.
1155+
1156+
This parameter has the "ISO 8601" format in order to be considered valid.
1157+
type: string
1158+
format: iso-date-time
1159+
example: '2019-05-01T00:00:00.519Z'
1160+
endDate:
1161+
description: >-
1162+
A date time value representing the end of an asset utilization interval.
1163+
1164+
This parameter has the "ISO 8601" format in order to be considered valid.
1165+
type: string
1166+
format: iso-date-time
1167+
example: '2019-05-20T00:00:00Z'
1168+
assetIdentifier:
1169+
description: String representing the unique identifier of an asset.
1170+
type: string
1171+
example: "29162;01B245D6;4243;0"
1172+
minionIdentifier:
1173+
description: Identifier of the minion where the asset is located.
1174+
type: string
1175+
example: NI_PXIe-8135_Embedded_Controller--MAC-00-80-2F-23-52-65
1176+
utilizationCategory:
1177+
description: String representing the utilization task category.
1178+
type: string
1179+
example: Test
1180+
user:
1181+
description: String representing the name of the operator who utilized the asset.
1182+
type: string
1183+
example: Test Engineer1
1184+
percentage:
1185+
description: Percentage of time that the asset was utilized in the specified time interval.
1186+
type: number
1187+
format: double
1188+
example: 7.38958
9601189
paths:
9611190
/:
9621191
get:
@@ -1367,6 +1596,27 @@ paths:
13671596
$ref: '#/responses/NotFound'
13681597
default:
13691598
$ref: '#/responses/Error'
1599+
/v1/query-asset-utilization:
1600+
post:
1601+
tags: [utilization]
1602+
summary: Query Asset Utilization
1603+
description: Retrieves asset utilization matching the provided filters.
1604+
operationId: read-asset-utilization
1605+
x-ni-operation: readAssetUtilization
1606+
x-ni-priviledge: Read
1607+
parameters:
1608+
- $ref: '#/parameters/QueryAssetUtilizationRequest'
1609+
responses:
1610+
200:
1611+
$ref: '#/responses/AssetUtilizationResponse'
1612+
400:
1613+
$ref: '#/responses/BadRequest'
1614+
401:
1615+
$ref: '#/responses/Unauthorized'
1616+
404:
1617+
$ref: '#/responses/NotFound'
1618+
default:
1619+
$ref: '#/responses/Error'
13701620
/v1/policy:
13711621
get:
13721622
tags: [policy]

0 commit comments

Comments
 (0)