From a017f6233987dd489e0926d4a8484c360c13adf5 Mon Sep 17 00:00:00 2001 From: Paul Spangler Date: Thu, 11 Apr 2019 11:34:17 -0500 Subject: [PATCH] Push changes for SystemLink 19.0 (#46) * Merge commit '8c198c083018c6bc75205e6c5f30ca88b9839518' into users/pspangle/openapi * Add user info in swagger for nifile. * Update yml so size64 is less confusing in swagger editor. size and size64 should be the same or size should be -1. * Merged PR 23221: Mark Test Monitor Inputs/Outputs values as not required and bump Swagger CodeGen version --- file/nifile.yml | 27 ++++-- test-monitor/nitestmonitor.yml | 158 ++++++++++++++++++++++++++++++--- user-data/niuserdata.yml | 59 +++--------- 3 files changed, 181 insertions(+), 63 deletions(-) diff --git a/file/nifile.yml b/file/nifile.yml index 38a5d65..4e949d4 100644 --- a/file/nifile.yml +++ b/file/nifile.yml @@ -12,6 +12,10 @@ consumes: [application/json] produces: [application/json] securityDefinitions: + apiKeyAuth: + type: apiKey + name: x-ni-api-key + in: header basicAuth: type: basic cookieAuth: @@ -20,6 +24,7 @@ securityDefinitions: name: Cookie security: + - apiKeyAuth: [] - basicAuth: [] - cookieAuth: [] x-ni-routing-key: Skyline.FileIngestion @@ -43,6 +48,7 @@ definitions: code: description: Numeric error code type: integer + format: int32 resourceType: description: Type of resource associated with the error type: string @@ -128,12 +134,13 @@ definitions: size: description: The 32-bit file size in bytes. If the value is larger than a 32-bit integer, this value is -1 and the size64 parameter contains the correct value. type: integer + format: int32 example: 7277 size64: description: The 64-bit file size in bytes type: integer format: int64 - example: 2147483648 + example: 7277 ServiceGroup: type: object properties: @@ -218,6 +225,7 @@ definitions: value: description: The value of the field to search for type: integer + format: int32 example: 5000 required: - operation @@ -298,6 +306,7 @@ definitions: description: Whether the operation is available to the caller version: type: integer + format: int32 description: The version of the available operation required: [available] example: @@ -389,6 +398,7 @@ responses: totalCount: description: The total number of files that match the query regardless of skip and take values type: integer + format: int64 example: 1 Error: description: Error @@ -513,8 +523,9 @@ paths: For example, a list of 100 files with a skip value of 50 and a take value of 25 will return entries 51 through 75. type: integer - x-ni-data-type: U32 + format: int32 default: 0 + minimum: 0 - in: query name: take description: >- @@ -523,8 +534,9 @@ paths: For example, a list of 100 files with a skip value of 50 and a take value of 25 will return entries 51 through 75. type: integer - x-ni-data-type: U32 + format: int32 default: 0 + minimum: 0 maximum: 10000 - in: query name: orderBy @@ -638,6 +650,7 @@ paths: operationId: UpdateMetadata x-ni-operation: updateMetadata x-ni-privilege: ModifyFiles + x-ni-request-variables: [REMOTE_USER] parameters: - in: body name: metadata @@ -681,6 +694,7 @@ paths: operationId: DeleteMultiple x-ni-operation: deleteFiles x-ni-privilege: ModifyFiles + x-ni-request-variables: [REMOTE_USER] parameters: - in: body name: files @@ -734,16 +748,18 @@ paths: name: skip description: How many files to skip in the result when paging. New in version 2 of this operation. type: integer - x-ni-data-type: U32 + format: int32 default: 0 + minimum: 0 - in: query name: take description: >- How many files to return in the result, or 0 to use a default. New in version 2 of this operation. The default value is defined by the service. type: integer - x-ni-data-type: U32 + format: int32 default: 1000 + minimum: 0 maximum: 1000 - in: body name: query @@ -787,6 +803,7 @@ paths: operationId: Upload x-ni-operation: uploadFiles x-ni-privilege: UploadFiles + x-ni-request-variables: [REMOTE_USER] consumes: - multipart/form-data parameters: diff --git a/test-monitor/nitestmonitor.yml b/test-monitor/nitestmonitor.yml index df741a3..3f7b837 100644 --- a/test-monitor/nitestmonitor.yml +++ b/test-monitor/nitestmonitor.yml @@ -13,6 +13,10 @@ consumes: produces: - application/json securityDefinitions: + apiKeyAuth: + type: apiKey + name: x-ni-api-key + in: header basicAuth: type: basic cookieAuth: @@ -20,6 +24,7 @@ securityDefinitions: in: header name: Cookie security: + - apiKeyAuth: [] - basicAuth: [] - cookieAuth: [] x-ni-routing-key: Skyline.TestMonitor @@ -34,6 +39,7 @@ definitions: code: description: Numeric error code type: integer + format: int32 resourceType: description: Type of resource associated with the error type: string @@ -75,6 +81,7 @@ definitions: description: Whether the operation is available to the caller version: type: integer + format: int32 description: Version of the available operation required: [available] example: @@ -165,6 +172,21 @@ definitions: description: Status name type: string example: Passed + NamedValueObject: + title: Named Value + description: Represents a named value or parameter + type: object + required: + - name + properties: + name: + description: The name of the value + type: string + example: Voltage + value: + description: The value + type: object + example: 1.3 ResultField: title: Result Field description: Result field enum @@ -202,6 +224,8 @@ definitions: - TOTAL_TIME_IN_SECONDS - STARTED_AT - UPDATED_AT + - INPUTS + - OUTPUTS - DATA_MODEL - DATA ResultSortDefinitionObject: @@ -228,6 +252,41 @@ definitions: orderByDescending: type: boolean default: false + QueryOperation: + title: Query Operation + description: >- + Query operation enum. Note that 'LESS_THAN', 'GREATER_THAN', 'LESS_THAN_OR_EQUAL', and + 'GREATER_THAN_OR_EQUAL' are only supported when the data type of the comparison is a string, + ISO date time, or numeric value. These are not supported on booleans, arrays, or objects + (also known as dictionaries). + type: string + enum: + - EQUAL + - NOT_EQUAL + - LESS_THAN + - GREATER_THAN + - LESS_THAN_OR_EQUAL + - GREATER_THAN_OR_EQUAL + DictionaryQueryObject: + title: Dictionary Query + description: Dictionary query object + type: object + required: + - name + properties: + name: + description: The name of the dictionary key to query for. + type: string + value: + description: >- + The value to compare with. This is compared to the value that is stored in the + dictionary. When the comparison is performed, the value stored in the dictionary is on + the left hand side of the operation and this value is on the right hand side. + type: object + example: 1.2 + operation: + $ref: '#/definitions/QueryOperation' + default: 'EQUAL' TimeQueryObject: title: Time Query description: Time query object @@ -237,15 +296,7 @@ definitions: - comparisonValue properties: operation: - description: Operation enum - type: string - enum: - - EQUAL - - NOT_EQUAL - - LESS_THAN - - GREATER_THAN - - LESS_THAN_OR_EQUAL - - GREATER_THAN_OR_EQUAL + $ref: '#/definitions/QueryOperation' comparisonValue: description: ISO-8601 formatted timestamp value to compare type: string @@ -271,6 +322,7 @@ definitions: value: description: Number of whole time units relative to the current server time. type: integer + format: int32 example: 30 TestResultRequestObject: title: Test Result Request @@ -411,6 +463,7 @@ definitions: type: object additionalProperties: type: integer + format: int32 example: FAILED: 5 TestResultUpdateRequestObject: @@ -680,6 +733,51 @@ definitions: type: array items: $ref: '#/definitions/StatusObject' + inputs: + description: >- + This is a query on the inputs dictionary. It is represented by an array of an array of + objects referred to as 'Dictionary Query Objects'. When querying, all elements of the + inner array of 'Dictionary Query Objects' must match (an "and" relationship within the + inner array). Only one element in the outer array needs to match (an "or" relationship + within the outer array). + type: array + items: + description: >- + Inner array of 'Dictionary Query Objects' to query for. When querying, all elements of + the inner array of 'Dictionary Query Objects' must match (an "and" relationship within + the inner array). + type: array + items: + $ref: '#/definitions/DictionaryQueryObject' + example: + - - name: 'Current' + value: 1.2 + - name: 'Voltage' + value: 2.3 + operation: 'LESS_THAN_OR_EQUAL' + outputs: + description: >- + This is a query on the outputs dictionary. It is represented by an array of an array of + objects referred to as 'Dictionary Query Objects'. When querying, all elements of the + inner array of 'Dictionary Query Objects' must match (an "and" relationship within the + inner array). Only one element in the outer array needs to match (an "or" relationship + within the outer array). + type: array + items: + description: >- + Inner array of 'Dictionary Query Objects' to query for. When querying, all elements of + the inner array of 'Dictionary Query Objects' must match (an "and" relationship within + the inner array). + type: array + items: + $ref: '#/definitions/DictionaryQueryObject' + example: + - - name: 'Power' + value: 1.4 + operation: 'GREATER_THAN_OR_EQUAL' + - name: 'Power' + value: 2.3 + operation: 'LESS_THAN_OR_EQUAL' startedAtQuery: description: Time query object type: array @@ -743,6 +841,16 @@ definitions: format: double default: 0 example: 29.9 + inputs: + description: Inputs and their values passed to this test + type: array + items: + $ref: '#/definitions/NamedValueObject' + outputs: + description: Outputs and their values logged by this test + type: array + items: + $ref: '#/definitions/NamedValueObject' TestStepCreateOrUpdateRequestObject: title: Test Step Create or Update Request type: object @@ -807,6 +915,16 @@ definitions: type: string format: iso-date-time example: '2018-05-09T15:07:42.527921Z' + inputs: + description: Inputs and their values passed to this test + type: array + items: + $ref: '#/definitions/NamedValueObject' + outputs: + description: Outputs and their values logged by this test + type: array + items: + $ref: '#/definitions/NamedValueObject' dataModel: description: Custom string defining the model of the data object type: string @@ -837,16 +955,12 @@ responses: type: object required: - results - - totalCount properties: results: description: Array of test results type: array items: $ref: '#/definitions/TestResultResponseObject' - totalCount: - description: Number of matching test results - type: integer ResultsPartialSuccessResponse: description: Test Results Partial Success Response schema: @@ -911,6 +1025,7 @@ responses: totalCount: description: Number of matching test results type: integer + format: int64 StepsSuccessResponse: description: Test Steps Success Response schema: @@ -966,6 +1081,7 @@ responses: totalCount: description: Number of matching test steps type: integer + format: int64 StepsDeletePartialSuccessResponse: description: Delete Test Steps Partial Success Response schema: @@ -1052,11 +1168,15 @@ paths: - in: query name: skip type: integer + format: int32 default: 0 + minimum: 0 - in: query name: take type: integer + format: int32 default: -1 + minimum: -1 responses: 200: $ref: '#/responses/ResultsQueryResponse' @@ -1076,11 +1196,15 @@ paths: - in: query name: skip type: integer + format: int32 default: 0 + minimum: 0 - in: query name: take type: integer + format: int32 default: -1 + minimum: -1 responses: 200: $ref: '#/responses/ResultsQueryResponse' @@ -1243,11 +1367,15 @@ paths: - in: query name: skip type: integer + format: int32 default: 0 + minimum: 0 - in: query name: take type: integer + format: int32 default: -1 + minimum: -1 responses: 200: $ref: '#/responses/StepsQueryResponse' @@ -1267,11 +1395,15 @@ paths: - in: query name: skip type: integer + format: int32 default: 0 + minimum: 0 - in: query name: take type: integer + format: int32 default: -1 + minimum: -1 responses: 200: $ref: '#/responses/StepsQueryResponse' diff --git a/user-data/niuserdata.yml b/user-data/niuserdata.yml index 648d4dc..dbd90a7 100644 --- a/user-data/niuserdata.yml +++ b/user-data/niuserdata.yml @@ -150,7 +150,7 @@ definitions: comparisonValue: description: Integer value to compare type: integer - format: int32 + format: int64 example: 360 JsonQueryObject: title: JSON Query @@ -245,19 +245,6 @@ definitions: - '5c4b2c0756c8b455a8f849c4' - '5c4ed77d56c8b455a80f86b5' - '5c4ed78f56c8b455a80f870a' - users: - description: >- - Array of user names. For normal users, this field is typically not set because the - query results will be restricted to the particular user's access level, which for - normal users is just user data items that belong to the same user and any user data - items that have 'visibleToOthers' set to true. This field is typically intended for - administrator use where the desired purpose is to manage the data of other users. - type: array - items: - type: string - example: - - 'jsmith' - - 'jdoe' applications: description: Array of application names type: array @@ -334,17 +321,6 @@ definitions: identified by a combination of its 'user', 'application', 'category', and 'name' fields. A specific user data item is also uniquely identified by its assigned ID. type: object - required: - - id - - user - - application - - category - - name - - value - - visibleToOthers - - revision - - createdAt - - updatedAt properties: id: description: The ID for this user data item. @@ -380,7 +356,6 @@ definitions: Whether this user data item is visible to other users. This will allow other users to query this data. type: boolean - default: false example: false revision: description: >- @@ -388,7 +363,7 @@ definitions: revision number starts at 1. Every time it is updated, the revision number is incremented by 1. type: integer - format: int32 + format: int64 example: 1 createdAt: description: ISO-8601 formatted timestamp specifying when the user data item was created. @@ -404,23 +379,15 @@ definitions: CreateOrUpdateUserDataItem: title: Create or Update User Data Item description: >- - Create or update a specific user data item. A specific user data item may be uniquely - identified by a combination of its 'user', 'application', 'category', and 'name' fields. + Create or update a specific user data item. User data items are unique to the currently + logged in user. The combination of the 'application', 'category', and 'name' fields identify + the specific item to create or update. type: object required: - application - name - value properties: - user: - description: >- - The user that this data item belongs to. When this is not set, the service will - automatically use the currently logged in user. For normal use cases, this is the - recommended usage (to leave this field unset). This field is intended for the use of - administrators, where it may be desired to create or update user data items on behalf of - another user. - type: string - example: jsmith application: description: >- The application name that this user data item belongs to. @@ -447,7 +414,7 @@ definitions: query this data. type: boolean example: false - revisionLock: + expectedRevision: description: >- This is an optional value. When specified, this is an integer that should be set to match the last known revision number of the user data item. If it doesn't match at the @@ -456,7 +423,7 @@ definitions: important, for instance, in the case where multiple clients are updating an array value at the same time. A value of 0 means that the item must not already exist. type: integer - format: int32 + format: int64 minimum: 0 example: 5 UpdateUserDataItem: @@ -466,6 +433,7 @@ definitions: type: object required: - id + - value properties: id: description: The ID for this user data item. @@ -481,7 +449,7 @@ definitions: query this data. type: boolean example: false - revisionLock: + expectedRevision: description: >- This is an optional value. When specified, this is an integer that should be set to match the last known revision number of the user data item. If it doesn't match at the @@ -490,7 +458,7 @@ definitions: important, for instance, in the case where multiple clients are updating an array value at the same time. type: integer - format: int32 + format: int64 minimum: 1 example: 5 CreateOrUpdateUserDataItemsPartialSuccessResponse: @@ -676,7 +644,7 @@ paths: format: int32 minimum: 0 - in: query - name: orderBy + name: sortBy description: The name of the field to sort by. type: string enum: @@ -719,7 +687,7 @@ paths: totalCount: description: Number of matching user data items type: integer - format: int32 + format: int64 post: operationId: CreateOrUpdateUserDataItems x-ni-operation: createOrUpdateUserDataItems @@ -848,7 +816,7 @@ paths: totalCount: description: Number of matching user data items type: integer - format: int32 + format: int64 401: $ref: '#/responses/Unauthorized' default: @@ -893,6 +861,7 @@ paths: x-ni-operation: deleteUserDataItems x-ni-privilege: Write x-ni-request-all-privileges: true + x-ni-request-variables: [REMOTE_USER] summary: Delete user data items description: >- Deletes multiple user data items in a single API call.