├── README.md ├── .github └── PULL_REQUEST_TEMPLATE.md ├── package.json ├── .travis.yml ├── LICENSE ├── CONTRIBUTING.md ├── service-registry └── niserviceregistry.yml ├── asset-management-rule └── niapmrule.yml ├── message └── nimessage.yml ├── webapp └── niapp.yaml ├── tdm-reader └── nitdmreader.yml ├── tag-rule └── nitagrule.yml ├── user └── niuser.yaml ├── user-data └── niuserdata.yml └── file └── nifile.yml /README.md: -------------------------------------------------------------------------------- 1 | # SystemLink OpenAPI Documents 2 | 3 | This repository contains OpenAPI documents which describe some of the HTTP APIs provided by web services in SystemLink and SystemLink Cloud. 4 | 5 | ## Using an OpenAPI document to generate a client 6 | 7 | To generate a client from an OpenAPI document, paste the document into [editor.swagger.io](https://editor.swagger.io), click "Generate Client", and select a language. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | - [ ] This contribution adheres to [CONTRIBUTING.md](https://github.com/ni/systemlink-OpenAPI-documents/blob/master/CONTRIBUTING.md). 2 | 3 | TODO: Check the above box with an 'x' indicating you've read and followed [CONTRIBUTING.md](https://github.com/ni/systemlink-OpenAPI-documents/blob/master/CONTRIBUTING.md). 4 | 5 | ### What does this Pull Request accomplish? 6 | 7 | TODO: Include high-level description of the changes in this pull request. 8 | 9 | ### Why should this Pull Request be merged? 10 | 11 | TODO: Justify why this contribution should be part of the project. 12 | 13 | ### What testing has been done? 14 | 15 | TODO: Detail what testing has been done to ensure this submission meets requirements. 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ni-kismet/systemlink-openapi-documents", 3 | "version": "1.0.1", 4 | "description": "Package containing OpenAPI documents which describe some of the HTTP APIs provided by web services in SystemLink and SystemLink Cloud", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/ni/systemlink-OpenAPI-documents.git" 12 | }, 13 | "author": "National Instruments", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/ni/systemlink-OpenAPI-documents/issues" 17 | }, 18 | "homepage": "https://github.com/ni/systemlink-OpenAPI-documents#readme" 19 | } 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | deploy: 3 | provider: npm 4 | email: webapps.ops@ni.com 5 | api_key: 6 | secure: S3pu1Ti7RpTxoA6SuDlYsKhxQ5QRxFRqDX1Q1w9rRyGYCWHG1XoLW8Tw7P7TrKEii8sjL+D6+dt2NGm/uTpE1fetOBA/0+gF8z8gTgS9QI0XMfjTJ0twtIFWdEPQ39pX/MlWJXPW2r80iGNyXsdx+USD3s9ucRDXkX2xbHt/EkSDoRQR64yJd3ZZYcReO+YFlaA5q0eF++WmdHkbC7exnl33d0BQjuaVA/f8tpWVfQLZZExMCFSircOG3R8GDY00KkIMkoeTMpMSPTpH9LKQLrI7Au4A/SH/W26p894LQgoijU9uid52PQtFbr/InWGLJexjqPoSRMeMmlAE4GYPCb0DV7XOxcj1OrDdKJdreap/hUTWDQoiMimC6prg2l83jdhtLoPzidITsLkU+R9GWLG9NFD8biLa9TzJT/3hlYiicmNmsBPjLY86aSb3aFAz5K0N1ZS3M4R5W3SOAMa8Ewbt3ygzBQO+K4SEEXVt0huPacrUh0M4Q84CqitTbXWivjZ5FjWsRdhWqsW/DGoM44IHF+HIPkbpvb/lVhq3HYF0TvH4cCnaD/0injEiuaqROK97beqqH12mSpgyTMjP57Nh2P6lR5uCvWL997nxIQz+QW1Ae8/BqQwwEFvdWU9CX8M6yX/SuhwSaVaJzcKHIxQ9ZRGzYATelOzrgTtbsFM= 7 | on: 8 | repo: ni/systemlink-OpenAPI-documents 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, National Instruments Corp. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to systemlink-OpenAPI-documents 2 | 3 | Contributions to systemlink-OpenAPI-documents are welcome from all! 4 | 5 | systemlink-OpenAPI-documents is managed via [git](https://git-scm.com), with the canonical upstream 6 | repository hosted on [GitHub](https://github.com/ni/systemlink-OpenAPI-documents/). 7 | 8 | systemlink-OpenAPI-documents follows a pull-request model for development. If you wish to 9 | contribute, you will need to create a GitHub account, fork this project, push a 10 | branch with your changes to your project, and then submit a pull request. 11 | 12 | See [GitHub's official documentation](https://help.github.com/articles/using-pull-requests/) for more details. 13 | 14 | # Testing 15 | 16 | Before making a pull request, ensure that there are no syntax errors in your document by pasting it into [editor.swagger.io](https://editor.swagger.io). 17 | 18 | # Developer Certificate of Origin (DCO) 19 | 20 | Developer's Certificate of Origin 1.1 21 | 22 | By making a contribution to this project, I certify that: 23 | 24 | (a) The contribution was created in whole or in part by me and I 25 | have the right to submit it under the open source license 26 | indicated in the file; or 27 | 28 | (b) The contribution is based upon previous work that, to the best 29 | of my knowledge, is covered under an appropriate open source 30 | license and I have the right under that license to submit that 31 | work with modifications, whether created in whole or in part 32 | by me, under the same open source license (unless I am 33 | permitted to submit under a different license), as indicated 34 | in the file; or 35 | 36 | (c) The contribution was provided directly to me by some other 37 | person who certified (a), (b) or (c) and I have not modified 38 | it. 39 | 40 | (d) I understand and agree that this project and the contribution 41 | are public and that a record of the contribution (including all 42 | personal information I submit with it, including my sign-off) is 43 | maintained indefinitely and may be redistributed consistent with 44 | this project or the open source license(s) involved. 45 | 46 | (taken from [developercertificate.org](https://developercertificate.org/)) 47 | 48 | See [LICENSE](https://github.com/ni/systemlink-OpenAPI-documents/blob/master/LICENSE) 49 | for details about how systemlink-OpenAPI-documents is licensed. 50 | -------------------------------------------------------------------------------- /service-registry/niserviceregistry.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: Service Registry Web Service 5 | description: View information about installed SystemLink services 6 | contact: 7 | name: NI 8 | url: 'https://www.ni.com/systemlink' 9 | email: support@ni.com 10 | basePath: /niserviceregistry 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | definitions: 16 | Statement: 17 | description: Contains information about a statement 18 | type: object 19 | properties: 20 | actions: 21 | description: Contains information about actions that can be performed 22 | type: array 23 | items: 24 | type: string 25 | example: ['asset:*'] 26 | type: 27 | description: Contains information about the resource type for which the statement applies 28 | type: string 29 | example: "asset" 30 | Translation: 31 | description: Contains translation information for a permission configuration 32 | type: object 33 | properties: 34 | en-us: 35 | description: The united states english permission name translation 36 | type: string 37 | example: "All" 38 | zn-ch: 39 | description: The traditional chinese permission name translation 40 | type: string 41 | example: "所有" 42 | de: 43 | description: The german permission name translation 44 | type: string 45 | example: "Alle" 46 | ja: 47 | description: The japanese permission name translation 48 | type: string 49 | example: "すべて" 50 | Permission: 51 | description: Contains information about a installed permission 52 | type: object 53 | properties: 54 | id: 55 | description: The ID of the permission 56 | type: string 57 | example: "1242342" 58 | translation: 59 | $ref: '#/definitions/Translation' 60 | statements: 61 | type: array 62 | items: 63 | $ref: '#/definitions/Statement' 64 | Privilege: 65 | description: Contains information about a installed privilege 66 | type: object 67 | properties: 68 | id: 69 | description: The ID of the privilege 70 | type: string 71 | example: "12314121" 72 | show: 73 | description: Specifies whether this privilege is user visible 74 | type: boolean 75 | example: true 76 | showResource: 77 | description: Specifies whether the resource specificity to be shown 78 | type: boolean 79 | example: false 80 | permissions: 81 | type: array 82 | items: 83 | $ref: '#/definitions/Permission' 84 | responses: 85 | PrivilegeResponse: 86 | description: Response containing a list of installed privileges 87 | schema: 88 | description: Response containing a list of installed privileges 89 | title: Privilege Response 90 | type: object 91 | required: 92 | - privileges 93 | properties: 94 | privileges: 95 | description: Array of installed privilege information 96 | type: array 97 | items: 98 | $ref: '#/definitions/Privilege' 99 | Unauthorized: 100 | description: Not authorized 101 | headers: 102 | WWW_Authenticate: 103 | description: Information for how to authenticate 104 | type: string 105 | paths: 106 | /v1/privileges: 107 | get: 108 | tags: [privileges] 109 | summary: Get installed SystemLink privilege configuration 110 | description: Gets information about installed privileges 111 | operationId: get-privileges 112 | responses: 113 | 200: 114 | $ref: '#/responses/PrivilegeResponse' 115 | 401: 116 | $ref: '#/responses/Unauthorized' -------------------------------------------------------------------------------- /asset-management-rule/niapmrule.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: Asset Performance Management Rule Web Service 5 | description: Create and manage calibration rules for assets. 6 | contact: 7 | name: NI 8 | url: 'https://www.ni.com/systemlink' 9 | email: support@ni.com 10 | basePath: /niapmrule 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | securityDefinitions: 16 | apiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | basicAuth: 21 | type: basic 22 | cookieAuth: 23 | type: apiKey 24 | in: header 25 | name: Cookie 26 | security: 27 | - apiKeyAuth: [] 28 | - basicAuth: [] 29 | - cookieAuth: [] 30 | x-ni-routing-key: Skyline.AssetPerformanceManagementRuleEngine 31 | x-ni-privilege-application: ninotification 32 | definitions: 33 | Error: 34 | description: Contains error information. 35 | type: object 36 | properties: 37 | name: 38 | description: String error code 39 | type: string 40 | code: 41 | description: Numeric error code 42 | type: integer 43 | resourceType: 44 | description: Type of resource associated with the error 45 | type: string 46 | resourceId: 47 | description: Identifier of the resource associated with the error 48 | type: string 49 | message: 50 | description: Complete error message 51 | type: string 52 | args: 53 | description: Positional argument values for the error code 54 | type: array 55 | items: 56 | type: string 57 | innerErrors: 58 | type: array 59 | items: 60 | $ref: '#/definitions/Error' 61 | example: 62 | name: Skyline.OneOrMoreErrorsOccurred 63 | code: -251040 64 | message: >- 65 | One or more errors occurred. See the contained list for details of each 66 | error. 67 | args: [] 68 | innerErrors: 69 | - name: AssetPerformanceManagementRuleEngine.RuleNotFound 70 | code: -254051 71 | resourceType: CalibrationRuleEntry 72 | resourceId: 4afb2ce3741fe11d88838cc9 73 | message: "The rule with identifier 4afb2ce3741fe11d88838cc9 was not found." 74 | args: [ 4afb2ce3741fe11d88838cc9 ] 75 | Operation: 76 | description: An operation provided by the API. 77 | type: object 78 | required: 79 | - available 80 | properties: 81 | available: 82 | type: boolean 83 | description: Whether or not the operation is available to the caller. 84 | version: 85 | type: integer 86 | description: Version of the available operation. 87 | example: 88 | available: true 89 | version: 1 90 | V1Operations: 91 | title: V1 Operations 92 | description: Object containing available operations in the v1 version of the API. 93 | type: object 94 | properties: 95 | operations: 96 | description: >- 97 | Available operations in the v1 version of the API: 98 | 99 | - getCalibrationRule: Obtain calibration rule information. 100 | 101 | - updateCalibrationRule: Update calibration rule information. 102 | type: object 103 | properties: 104 | getCalibrationRule: 105 | $ref: '#/definitions/Operation' 106 | updateCalibrationRule: 107 | $ref: '#/definitions/Operation' 108 | CalibrationSeverityModel: 109 | title: Calibration Severity Model 110 | description: A calibration severity level for a rule. 111 | type: object 112 | required: 113 | - name 114 | - severityLevel 115 | - daysUntilCalibrationDue 116 | properties: 117 | name: 118 | description: The name of the severity. 119 | type: string 120 | example: Approaching 121 | severityLevel: 122 | description: The level of the severity. 123 | type: integer 124 | minimum: 1 125 | maximum: 4 126 | default: 2 127 | example: 2 128 | notificationStrategyIds: 129 | description: The unique identifiers for notification strategies to use when this rule is triggered for an asset. 130 | type: array 131 | items: 132 | type: string 133 | example: e3491890f7b15b83d3fc174a 134 | daysUntilCalibrationDue: 135 | description: The number of days until recommended calibration due date to trigger the alarm. 136 | type: integer 137 | example: 30 138 | CalibrationRulePutRequestModel: 139 | title: Calibration Rule Put Request Model 140 | description: A request to replace a calibration rule. 141 | type: object 142 | required: 143 | - displayName 144 | - description 145 | - disabled 146 | - instanceDisplayNameTemplate 147 | - instanceDescriptionTemplate 148 | - severityLevels 149 | properties: 150 | displayName: 151 | description: Display name of the rule. 152 | type: string 153 | example: Calibration 154 | description: 155 | description: Description of what the rule does. 156 | type: string 157 | example: Rule to identify assets that passed their recommended calibration due date. 158 | disabled: 159 | description: Whether or not the rule is disabled. 160 | type: boolean 161 | example: false 162 | instanceDisplayNameTemplate: 163 | description: Template used for the display name that appears on an alarm instance created by this rule. 164 | type: string 165 | example: Asset passed recommended calibration date. 166 | instanceDescriptionTemplate: 167 | description: Template used for the description that appears on an alarm instance created by this rule. 168 | type: string 169 | example: Asset from system has the next recommended calibration date as but that date already passed. 170 | severityLevels: 171 | description: Severity levels for the alarm rule. 172 | type: array 173 | items: 174 | $ref: '#/definitions/CalibrationSeverityModel' 175 | CalibrationRuleModel: 176 | allOf: 177 | - $ref: '#/definitions/CalibrationRulePutRequestModel' 178 | - title: Calibration Rule Model 179 | - description: A calibration rule that runs on assets. 180 | - type: object 181 | - required: 182 | - id 183 | - properties: 184 | id: 185 | description: Calibration rule identifier. 186 | type: string 187 | example: "5b83d3fc174ae3491890f7ae" 188 | lastUpdatedTimestamp: 189 | description: ISO-8601 formatted timestamp specifying the last date the rule was updated. 190 | type: string 191 | format: date-time 192 | example: '2018-05-07T18:58:05.219692Z' 193 | workspace: 194 | type: string 195 | description: The ID of the workspace. 196 | example: '5bc5e9092a4fa4c71cfa7197' 197 | RuleStateUpdateModel: 198 | title: Rule State Update Model 199 | description: The collection of rule identifiers and the enable/disable state to apply on them. 200 | type: object 201 | required: 202 | - ruleIds 203 | - disabled 204 | properties: 205 | ruleIds: 206 | description: Array containing the rule identifiers on which to set the enable/disable state. 207 | type: array 208 | items: 209 | type: string 210 | example: '5b83d3fc174ae3491890f7ae' 211 | disabled: 212 | description: Whether or not to disable all the specified rules. 213 | type: boolean 214 | example: true 215 | parameters: 216 | RuleId: 217 | in: path 218 | name: ruleId 219 | description: Calibration rule identifier. 220 | type: string 221 | required: true 222 | x-example: '5b83d3fc174ae3491890f7ae' 223 | SetRulesState: 224 | in: body 225 | name: setRulesState 226 | description: The collection of rule identifiers and the enable/disable state to apply on them. 227 | required: true 228 | schema: 229 | $ref: '#/definitions/RuleStateUpdateModel' 230 | Workspaces: 231 | in: query 232 | name: workspaces 233 | description: A string representing the collection of workspace IDs separated by comma used to filter the rules. 234 | required: false 235 | type: string 236 | x-example: '5bc5e9092a4fa4c71cfa7197,3a83d3fc174ae3491890f7ae' 237 | responses: 238 | BadRequest: 239 | description: The server was unable to process the request because of invalid syntax. 240 | schema: 241 | title: Bad Request Error Response 242 | description: Bad request error response containing error information. 243 | type: object 244 | properties: 245 | error: 246 | $ref: '#/definitions/Error' 247 | NotFound: 248 | description: The requested resource was not found. 249 | schema: 250 | title: Not Found Request Error Response 251 | description: Not found error response containing error information. 252 | type: object 253 | properties: 254 | error: 255 | $ref: '#/definitions/Error' 256 | CalibrationRuleResponse: 257 | description: Response containing the rule having the specified identifier. 258 | schema: 259 | $ref: '#/definitions/CalibrationRuleModel' 260 | CalibrationRulesResponse: 261 | description: Response containing all the calibration rules that the service manages. 262 | schema: 263 | description: Response containing all the calibration rules. 264 | title: Calibration Rules Response 265 | type: object 266 | required: 267 | - calibrationRules 268 | - totalCount 269 | properties: 270 | calibrationRules: 271 | description: Array of calibration rules. 272 | type: array 273 | items: 274 | $ref: '#/definitions/CalibrationRuleModel' 275 | totalCount: 276 | description: The total number of calibration rules. 277 | type: integer 278 | example: 1 279 | Error: 280 | description: Error 281 | schema: 282 | description: Error response containing error information. 283 | title: Error Response 284 | type: object 285 | properties: 286 | error: 287 | $ref: '#/definitions/Error' 288 | PartialSuccessResponse: 289 | description: Rules update was partially successful. Only part of the requested information was successfully processed. 290 | schema: 291 | title: Partial Success Response 292 | description: Partial success response containing error information. 293 | type: object 294 | properties: 295 | error: 296 | $ref: '#/definitions/Error' 297 | Unauthorized: 298 | description: Not authorized 299 | headers: 300 | WWW_Authenticate: 301 | description: Information for how to authenticate 302 | type: string 303 | paths: 304 | /: 305 | get: 306 | tags: [versioning] 307 | summary: API information 308 | description: Returns information about API versions and available operations. 309 | operationId: RootEndpoint 310 | # Explicitly mark security as an empty array - this route does not require any privileges. 311 | # Marking it this way prevents it from inheriting the top-level security settings. 312 | security: [] 313 | responses: 314 | 200: 315 | description: OK 316 | schema: 317 | description: Version information 318 | title: Root Endpoint Response 319 | type: object 320 | properties: 321 | v1: 322 | $ref: '#/definitions/V1Operations' 323 | version: 324 | description: Defines the implementation version of the web service. 325 | type: string 326 | example: 1 327 | /{version}: 328 | parameters: 329 | - in: path 330 | name: version 331 | description: The version of the API to retrieve operations. 332 | type: string 333 | required: true 334 | get: 335 | tags: [versioning] 336 | summary: API version information 337 | description: Returns available operations for a single version of the API. 338 | operationId: RootEndpointWithVersion 339 | security: [] 340 | responses: 341 | 200: 342 | description: OK 343 | schema: 344 | $ref: '#/definitions/V1Operations' 345 | 404: 346 | $ref: '#/responses/NotFound' 347 | default: 348 | $ref: '#/responses/Error' 349 | /v1/calibration-rules: 350 | get: 351 | tags: [calibration rules] 352 | summary: Get calibration rules 353 | description: Gets a list containing all rules specific to calibration. 354 | operationId: get-calibration-rules 355 | x-ni-operation: getCalibrationRule 356 | x-ni-auth: true 357 | parameters: 358 | - $ref: '#/parameters/Workspaces' 359 | responses: 360 | 200: 361 | $ref: '#/responses/CalibrationRulesResponse' 362 | 401: 363 | $ref: '#/responses/Unauthorized' 364 | default: 365 | $ref: '#/responses/Error' 366 | /v1/calibration-rules/{ruleId}: 367 | parameters: 368 | - $ref: '#/parameters/RuleId' 369 | get: 370 | tags: [calibration rules] 371 | summary: Get a specific calibration rule 372 | description: Gets the calibration rule with the specified identifier. 373 | operationId: get-calibration-rule-by-id 374 | x-ni-operation: getCalibrationRule 375 | x-ni-auth: true 376 | responses: 377 | 200: 378 | $ref: '#/responses/CalibrationRuleResponse' 379 | 400: 380 | $ref: '#/responses/BadRequest' 381 | 401: 382 | $ref: '#/responses/Unauthorized' 383 | 404: 384 | $ref: '#/responses/NotFound' 385 | default: 386 | $ref: '#/responses/Error' 387 | put: 388 | tags: [calibration rules] 389 | summary: Replace a specific calibration rule 390 | description: Replaces a specific calibration rule with the given one. 391 | operationId: put-calibration-rule 392 | x-ni-operation: updateCalibrationRule 393 | x-ni-auth: true 394 | parameters: 395 | - in: body 396 | name: CalibrationRulePutRequestModel 397 | description: The calibration rule that replaces the other rule. 398 | required: true 399 | schema: 400 | $ref: '#/definitions/CalibrationRulePutRequestModel' 401 | responses: 402 | 204: 403 | description: No Content 404 | 400: 405 | $ref: '#/responses/BadRequest' 406 | 401: 407 | $ref: '#/responses/Unauthorized' 408 | 404: 409 | $ref: '#/responses/NotFound' 410 | default: 411 | $ref: '#/responses/Error' 412 | /v1/set-calibration-rules-state: 413 | post: 414 | tags: [calibration rules] 415 | summary: Set specific calibration rules state 416 | description: Sets specific calibration rules state by enabling or disabling them. 417 | operationId: set-calibration-rules-state 418 | x-ni-operation: updateCalibrationRule 419 | x-ni-auth: true 420 | parameters: 421 | - $ref: '#/parameters/SetRulesState' 422 | responses: 423 | 200: 424 | $ref: '#/responses/PartialSuccessResponse' 425 | 204: 426 | description: No Content 427 | 400: 428 | $ref: '#/responses/BadRequest' 429 | 401: 430 | $ref: '#/responses/Unauthorized' 431 | 404: 432 | $ref: '#/responses/NotFound' 433 | default: 434 | $ref: '#/responses/Error' 435 | -------------------------------------------------------------------------------- /message/nimessage.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | description: Send and receive messages between systems using a publish-subscribe model. 4 | version: '1' 5 | title: SystemLink Message Service 6 | contact: 7 | name: NI 8 | url: 'https://www.ni.com/systemlink' 9 | email: support@ni.com 10 | basePath: /nimessage 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | securityDefinitions: 16 | apiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | basicAuth: 21 | type: basic 22 | security: 23 | - apiKeyAuth: [] 24 | - basicAuth: [] 25 | 26 | responses: 27 | Unauthorized: 28 | description: Not authorized 29 | headers: 30 | WWW_Authenticate: 31 | description: Information for how to authenticate (sent only from SystemLink Server). 32 | type: string 33 | 34 | ValidationError: 35 | description: Invalid input data 36 | schema: 37 | description: Error response 38 | title: ErrorResponse 39 | type: object 40 | properties: 41 | error: 42 | $ref: '#/definitions/Error' 43 | 44 | Error: 45 | description: Error 46 | schema: 47 | description: Error response 48 | title: ErrorResponse 49 | type: object 50 | properties: 51 | error: 52 | $ref: '#/definitions/Error' 53 | 54 | parameters: 55 | Token: 56 | in: path 57 | name: token 58 | description: Unique session ID 59 | type: string 60 | required: true 61 | CreateSessionRequest: 62 | in: body 63 | name: createSessionRequest 64 | description: Request to create a new session 65 | schema: 66 | title: Create Session Request 67 | description: Creates a message session with the server to send and receive messages. 68 | type: object 69 | properties: 70 | workspace: 71 | type: string 72 | description: The ID of the workspace used by this session. 73 | example: 8472777d-8e2f-4c42-bceb-7901ede23085 74 | example: 75 | workspace: 8472777d-8e2f-4c42-bceb-7901ede23085 76 | 77 | paths: 78 | /v1/sessions: 79 | post: 80 | tags: 81 | - sessions 82 | summary: Create a session 83 | description: Creates a message session with the server to send and receive messages. 84 | operationId: CreateSession 85 | parameters: 86 | - $ref: '#/parameters/CreateSessionRequest' 87 | responses: 88 | 200: 89 | schema: 90 | $ref: '#/definitions/SessionToken' 91 | description: Success 92 | 400: 93 | $ref: '#/responses/ValidationError' 94 | 401: 95 | $ref: '#/responses/Unauthorized' 96 | 403: 97 | description: Reached the maximum number of sessions 98 | default: 99 | $ref: '#/responses/Error' 100 | /v1/sessions/{token}: 101 | delete: 102 | tags: 103 | - sessions 104 | summary: Delete a session 105 | description: Terminates the message session. If you do not delete the message session, the message service deletes the sesssion after five minutes of inactivity 106 | operationId: DeleteSession 107 | parameters: 108 | - $ref: '#/parameters/Token' 109 | responses: 110 | 204: 111 | description: Success 112 | 401: 113 | $ref: '#/responses/Unauthorized' 114 | default: 115 | $ref: '#/responses/Error' 116 | /v1/sessions/{token}/subscriptions/subscribe: 117 | post: 118 | tags: 119 | - topics 120 | summary: Subscribe to a topic 121 | description: Subscribes to a topic to receive all messages broadcast with that topic name. 122 | operationId: SubscribeToTopic 123 | parameters: 124 | - $ref: '#/parameters/Token' 125 | - in: body 126 | name: topic 127 | description: The topic to subscribe to 128 | required: true 129 | schema: 130 | $ref: '#/definitions/Topic' 131 | responses: 132 | 204: 133 | description: Success 134 | 401: 135 | $ref: '#/responses/Unauthorized' 136 | default: 137 | $ref: '#/responses/Error' 138 | /v1/sessions/{token}/subscriptions/unsubscribe: 139 | post: 140 | tags: 141 | - topics 142 | summary: Unsubscribe from a topic 143 | description: Unsubscribes from a topic to stop receiving messages for that topic. 144 | operationId: UnsubscribeFromTopic 145 | parameters: 146 | - $ref: '#/parameters/Token' 147 | - in: body 148 | name: topic 149 | description: Topic to unsubscribe from 150 | required: true 151 | schema: 152 | $ref: '#/definitions/Topic' 153 | responses: 154 | 204: 155 | description: Success 156 | 401: 157 | $ref: '#/responses/Unauthorized' 158 | default: 159 | $ref: '#/responses/Error' 160 | 161 | /v1/sessions/{token}/messages: 162 | post: 163 | tags: 164 | - message queue 165 | summary: Publish a message 166 | description: Broadcasts a message to a topic. Subscribers of a topic receive every message published to the topic. 167 | operationId: PublishMessage 168 | parameters: 169 | - $ref: '#/parameters/Token' 170 | - in: body 171 | name: topicAndMessage 172 | description: The message to publish, and the topic to publish to 173 | required: true 174 | schema: 175 | $ref: '#/definitions/TopicAndMessage' 176 | responses: 177 | 204: 178 | description: Success 179 | 401: 180 | $ref: '#/responses/Unauthorized' 181 | default: 182 | $ref: '#/responses/Error' 183 | get: 184 | tags: 185 | - message queue 186 | summary: Read a message from the queue 187 | description: Returns a message from the queue. To read a message, subscribe to a topic first. 188 | operationId: ReadMessage 189 | parameters: 190 | - $ref: '#/parameters/Token' 191 | - in: query 192 | name: timeoutMilliseconds 193 | description: Amount of time, in milliseconds, to keep the messaging connection open. May be overridden by a maximum value that the server administrator allows. 194 | type: integer 195 | required: false 196 | responses: 197 | 200: 198 | schema: 199 | $ref: '#/definitions/TopicAndMessage' 200 | description: Success 201 | 204: 202 | description: No messages were available. 203 | 401: 204 | $ref: '#/responses/Unauthorized' 205 | default: 206 | $ref: '#/responses/Error' 207 | delete: 208 | tags: 209 | - message queue 210 | summary: Flush the message queue 211 | description: Clears all messages from the session queue without reading them. 212 | operationId: DeleteMessages 213 | parameters: 214 | - $ref: '#/parameters/Token' 215 | responses: 216 | 204: 217 | description: Success 218 | 401: 219 | $ref: '#/responses/Unauthorized' 220 | default: 221 | $ref: '#/responses/Error' 222 | /v1/sessions/{token}/configuration/queueSizeBytes: 223 | get: 224 | tags: 225 | - message queue 226 | summary: Get the current queue size 227 | description: Returns the size (in bytes) of the message queue associated with this session. This is helpful for determining the amount of memory that unread messages are consuming. 228 | operationId: GetCurrentQueueSize 229 | parameters: 230 | - $ref: '#/parameters/Token' 231 | responses: 232 | 200: 233 | schema: 234 | $ref: '#/definitions/QueueSizeBytes' 235 | description: Success 236 | 401: 237 | $ref: '#/responses/Unauthorized' 238 | default: 239 | $ref: '#/responses/Error' 240 | /v1/sessions/{token}/configuration/maxQueueSizeBytes: 241 | get: 242 | tags: 243 | - message queue 244 | summary: Get the maximum queue size 245 | description: Returns the maximum size (in bytes) of the message queue associated with this session. This is helpful for determining how much total memory is available for storing messages. 246 | operationId: GetMaximumQueueSize 247 | parameters: 248 | - $ref: '#/parameters/Token' 249 | responses: 250 | 200: 251 | schema: 252 | $ref: '#/definitions/MaxQueueSizeBytes' 253 | description: Success 254 | 401: 255 | $ref: '#/responses/Unauthorized' 256 | default: 257 | $ref: '#/responses/Error' 258 | /v1/websocket: 259 | get: 260 | tags: 261 | - webSocket 262 | summary: Open a WebSocket session 263 | description: Opens a persistent connection to the web server that allows two-way communication using a JSON 264 | protocol. After you open a connection, you can publish messages and subscribe or unsubscribe to topics. 265 | Refer to the *Models* section to access the schema for these actions. 266 | operationId: OpenWebSocketSession 267 | parameters: 268 | - in: query 269 | name: workspace 270 | description: The ID of the workspace used by this session. 271 | type: string 272 | required: false 273 | x-example: c04c612b-0ba8-4c8e-a8af-a7f314c44715 274 | - in: header 275 | name: Upgrade 276 | type: string 277 | required: true 278 | x-example: websocket 279 | - in: header 280 | name: Connection 281 | type: string 282 | required: true 283 | x-example: Upgrade 284 | - in: header 285 | name: Sec-WebSocket-Version 286 | description: Protocol version of the WebSocket connection. 287 | type: string 288 | required: true 289 | x-example: 13 290 | - in: header 291 | name: Sec-WebSocket-Key 292 | description: Randomly selected sixteen-byte base64-encoded string. Used to confirm a valid WebSocket handshake. Must be selected randomly for each new connection. 293 | type: string 294 | required: true 295 | x-example: dGhlIHNhbXBsZSBub25jZQ== 296 | responses: 297 | 101: 298 | description: Switching Protocols 299 | headers: 300 | Sec-WebSocket-Accept: 301 | description: Used in the WebSocket opening handshake. Set to a value derived from the Sec-WebSocket-Key header. 302 | type: string 303 | 400: 304 | $ref: '#/responses/ValidationError' 305 | 401: 306 | $ref: '#/responses/Unauthorized' 307 | 403: 308 | description: Reached the maximum number of sessions 309 | 426: 310 | description: Upgrade Required 311 | 312 | definitions: 313 | Error: 314 | description: Contains error information 315 | type: object 316 | properties: 317 | name: 318 | description: String error code 319 | type: string 320 | code: 321 | description: Numeric error code 322 | type: integer 323 | resourceType: 324 | description: Type of resource associated with the error 325 | type: string 326 | resourceId: 327 | description: Identifier of the resource associated with the error 328 | type: string 329 | message: 330 | description: Complete error message 331 | type: string 332 | args: 333 | description: Positional argument values for the error code 334 | type: array 335 | items: 336 | type: string 337 | innerErrors: 338 | type: array 339 | items: 340 | $ref: '#/definitions/Error' 341 | example: 342 | name: Skyline.OneOrMoreErrorsOccurred 343 | code: -251040 344 | message: One or more errors occurred. See the contained list for details of each error. 345 | args: [] 346 | innerErrors: 347 | - name: Message.SessionTokenNotFound 348 | code: -251608 349 | resourceType: 350 | resourceId: 351 | message: Session token 'f755d531-2403-433f-a0b7-463ccb8f2b9' not found. 352 | args: ['f755d531-2403-433f-a0b7-463ccb8f2b9'] 353 | TopicAndMessage: 354 | type: object 355 | title: Topic and Message 356 | required: 357 | - topic 358 | - message 359 | properties: 360 | topic: 361 | description: Topic name 362 | type: string 363 | message: 364 | description: Message content 365 | type: string 366 | description: The topic and message content 367 | example: 368 | topic: systemHealth 369 | message: System A has crashed 370 | Topic: 371 | type: object 372 | title: Topic 373 | required: 374 | - topic 375 | properties: 376 | topic: 377 | description: Topic name 378 | type: string 379 | description: Topic name 380 | example: 381 | topic: systemHealth 382 | SessionToken: 383 | type: object 384 | title: Session Token 385 | required: 386 | - token 387 | properties: 388 | token: 389 | description: Unique session ID 390 | type: string 391 | description: Unique session ID 392 | example: 393 | token: BAB2AFFA-7AFA-4C79-BD41-00F25E3B8F61 394 | QueueSizeBytes: 395 | type: object 396 | title: Current Queue Size 397 | required: 398 | - queueSizeBytes 399 | properties: 400 | queueSizeBytes: 401 | description: Current queue size (in bytes) 402 | type: integer 403 | description: Current queue size (in bytes) 404 | example: 405 | queueSizeBytes: 100 406 | MaxQueueSizeBytes: 407 | type: object 408 | title: Maximum Queue Size 409 | required: 410 | - maxQueueSizeBytes 411 | properties: 412 | maxQueueSizeBytes: 413 | description: Maximum queue size (in bytes) 414 | type: integer 415 | description: Maximum queue size (in bytes) 416 | example: 417 | maxQueueSizeBytes: -1 418 | WebSocketPublish: 419 | type: object 420 | title: WebSocket Publish Action 421 | required: 422 | - action 423 | - topic 424 | - message 425 | properties: 426 | action: 427 | description: The action to perform. Must be set to "publish". 428 | type: string 429 | enum: ['publish'] 430 | example: publish 431 | topic: 432 | description: Topic to publish a message to 433 | type: string 434 | message: 435 | description: Message to publish 436 | type: string 437 | example: 438 | action: publish 439 | topic: systemHealth 440 | message: System A has crashed 441 | WebSocketSubscribe: 442 | type: object 443 | title: WebSocket Subscribe Action 444 | required: 445 | - action 446 | - topic 447 | properties: 448 | action: 449 | description: Action to perform. Must be set to "subscribe". 450 | type: string 451 | enum: ['subscribe'] 452 | example: subscribe 453 | topic: 454 | description: Topic to subscribe to 455 | type: string 456 | example: 457 | action: subscribe 458 | topic: systemHealth 459 | WebSocketUnsubscribe: 460 | type: object 461 | title: WebSocket Unsubscribe Action 462 | required: 463 | - action 464 | - topic 465 | properties: 466 | action: 467 | description: Action to perform. Must be set to "unsubscribe". 468 | type: string 469 | enum: ['unsubscribe'] 470 | example: unsubscribe 471 | topic: 472 | description: Topic to unsubscribe from 473 | type: string 474 | example: 475 | action: unsubscribe 476 | topic: systemHealth 477 | -------------------------------------------------------------------------------- /webapp/niapp.yaml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1.0' 4 | title: SystemLink WebApp Service 5 | basePath: /niapp/v1 6 | consumes: 7 | - application/json 8 | produces: 9 | - application/json 10 | securityDefinitions: 11 | ApiKeyAuth: 12 | type: apiKey 13 | name: x-ni-api-key 14 | in: header 15 | BasicAuth: 16 | type: basic 17 | security: 18 | - ApiKeyAuth: [] 19 | - BasicAuth: [] 20 | paths: 21 | '/webapps/{id}': 22 | get: 23 | tags: 24 | - metadata 25 | summary: Get webapp metadata by Id 26 | description: Get webapp metadata by Id 27 | operationId: get-webapp 28 | parameters: 29 | - $ref: '#/parameters/WebAppId' 30 | responses: 31 | 200: 32 | $ref: '#/responses/GetWebAppResponse' 33 | 401: 34 | $ref: '#/responses/Unauthorized' 35 | 404: 36 | $ref: '#/responses/NotFound' 37 | default: 38 | $ref: '#/responses/Error' 39 | put: 40 | tags: 41 | - metadata 42 | summary: Update webapp metadata by Id 43 | description: Update existing webapp metadata 44 | operationId: update-webapp 45 | parameters: 46 | - $ref: '#/parameters/WebAppId' 47 | - $ref: '#/parameters/UpdateWebAppRequest' 48 | responses: 49 | 200: 50 | $ref: '#/responses/UpdateWebAppResponse' 51 | 400: 52 | $ref: '#/responses/ValidationError' 53 | 401: 54 | $ref: '#/responses/Unauthorized' 55 | 404: 56 | $ref: '#/responses/NotFound' 57 | default: 58 | $ref: '#/responses/Error' 59 | delete: 60 | tags: 61 | - metadata 62 | summary: Delete webapp by Id 63 | description: Delete existing webapp metadata and content 64 | operationId: delete-webapp 65 | parameters: 66 | - $ref: '#/parameters/WebAppId' 67 | responses: 68 | 200: 69 | description: Success 70 | 401: 71 | $ref: '#/responses/Unauthorized' 72 | 404: 73 | $ref: '#/responses/NotFound' 74 | default: 75 | $ref: '#/responses/Error' 76 | '/webapps': 77 | get: 78 | tags: 79 | - metadata 80 | summary: List the webapps 81 | description: List the webapps 82 | operationId: list-webapps 83 | parameters: 84 | - in: query 85 | name: name 86 | description: Filters the webapps by name 87 | type: string 88 | - in: query 89 | name: type 90 | description: Filters the webapps by type 91 | type: string 92 | enum: 93 | - Dashboard 94 | - DashboardTemplate 95 | - WebVI 96 | - in: query 97 | name: userId 98 | description: Filters the webapps by the user Id of the owner 99 | type: string 100 | - in: query 101 | name: workspace 102 | description: Filters the webapps by workspace Id 103 | type: string 104 | - in: query 105 | name: continuationToken 106 | description: The continuation token can be used to paginate through the webapp list results. Provide a token to continue a previous listing. 107 | type: string 108 | - in: query 109 | name: take 110 | description: The maximum number of webapps to return 111 | type: integer 112 | default: 100 113 | minimum: 0 114 | maximum: 1000 115 | responses: 116 | 200: 117 | $ref: '#/responses/ListWebAppsResponse' 118 | 400: 119 | $ref: '#/responses/ValidationError' 120 | 401: 121 | $ref: '#/responses/Unauthorized' 122 | default: 123 | $ref: '#/responses/Error' 124 | post: 125 | tags: 126 | - metadata 127 | summary: Create a new webapp 128 | description: Create a new webapp 129 | operationId: create-webapp 130 | parameters: 131 | - $ref: '#/parameters/CreateWebAppRequest' 132 | responses: 133 | 200: 134 | $ref: '#/responses/CreateWebAppResponse' 135 | 401: 136 | $ref: '#/responses/Unauthorized' 137 | default: 138 | $ref: '#/responses/Error' 139 | '/webapps/query': 140 | post: 141 | tags: 142 | - metadata 143 | summary: Query the webapps 144 | description: >- 145 | Use the Dynamic Linq query language to specify filters for webapps. 146 | An empty request body queries all webapps. 147 | operationId: query 148 | parameters: 149 | - in: body 150 | name: postBody 151 | description: Query filter 152 | required: false 153 | schema: 154 | $ref: '#/definitions/WebAppsAdvancedQuery' 155 | responses: 156 | 200: 157 | $ref: '#/responses/ListWebAppsResponse' 158 | 400: 159 | $ref: '#/responses/ValidationError' 160 | 401: 161 | $ref: '#/responses/Unauthorized' 162 | default: 163 | $ref: '#/responses/Error' 164 | '/webapps/{id}/sharing': 165 | put: 166 | tags: 167 | - metadata 168 | summary: Update sharing settings of the webapp 169 | description: Update sharing settings of the webapp 170 | operationId: update-webapp-sharing 171 | parameters: 172 | - $ref: '#/parameters/WebAppId' 173 | - $ref: '#/parameters/UpdateWebAppSharingRequest' 174 | responses: 175 | 200: 176 | $ref: '#/responses/UpdateWebAppSharingResponse' 177 | 400: 178 | $ref: '#/responses/ValidationError' 179 | 401: 180 | $ref: '#/responses/Unauthorized' 181 | 404: 182 | $ref: '#/responses/NotFound' 183 | default: 184 | $ref: '#/responses/Error' 185 | '/webapps/shared-emails': 186 | get: 187 | tags: 188 | - metadata 189 | summary: List the emails with which the user has shared webapps 190 | description: List the emails with which the user has shared webapps 191 | operationId: list-shared-emails 192 | responses: 193 | 200: 194 | $ref: '#/responses/SharedEmailsResponse' 195 | 401: 196 | $ref: '#/responses/Unauthorized' 197 | default: 198 | $ref: '#/responses/Error' 199 | '/webapps/import': 200 | post: 201 | tags: 202 | - metadata 203 | summary: Import webapp metadata 204 | description: >- 205 | Import a list of webapp metadata. 206 | 207 | The webapp Id, created timestamp, and updated timestamp are optional. These fields will be generated by the service if they are not provided in the request. 208 | operationId: import-webapps 209 | parameters: 210 | - $ref: '#/parameters/ImportWebAppsRequest' 211 | responses: 212 | 200: 213 | $ref: '#/responses/ImportWebAppsResponse' 214 | 401: 215 | $ref: '#/responses/Unauthorized' 216 | default: 217 | $ref: '#/responses/Error' 218 | '/webapps/{id}/content': 219 | get: 220 | tags: 221 | - content 222 | summary: Get webapp content 223 | description: Get the content of a webapp. ContentType varies from JSON for dashboards and templates or redirect to main HTML for WebVIs 224 | operationId: get-content-index 225 | parameters: 226 | - $ref: '#/parameters/WebAppId' 227 | responses: 228 | 200: 229 | description: The webapp's content. JSON for Dashboards, HTML for WebVIs 230 | 401: 231 | $ref: '#/responses/Unauthorized' 232 | 404: 233 | $ref: '#/responses/NotFound' 234 | default: 235 | $ref: '#/responses/Error' 236 | put: 237 | tags: 238 | - content 239 | summary: Upload content for an existing webapp 240 | description: Upload content for an existing webapp 241 | operationId: update-content 242 | parameters: 243 | - $ref: '#/parameters/WebAppId' 244 | - in: body 245 | required: true 246 | name: content 247 | description: The webapp content to upload 248 | schema: 249 | $ref: '#/definitions/WebAppContent' 250 | responses: 251 | 200: 252 | description: Success 253 | 400: 254 | $ref: '#/responses/ValidationError' 255 | 401: 256 | $ref: '#/responses/Unauthorized' 257 | 404: 258 | $ref: '#/responses/NotFound' 259 | default: 260 | $ref: '#/responses/Error' 261 | '/webapps/{id}/content/{path}': 262 | get: 263 | tags: 264 | - content 265 | summary: Get webapp content by path 266 | description: Get the webapp content at a path. This applies to webapps with multiple files, such as WebVIs. 267 | operationId: get-content 268 | parameters: 269 | - $ref: '#/parameters/WebAppId' 270 | - $ref: '#/parameters/WebAppContentPath' 271 | responses: 272 | 200: 273 | $ref: '#/definitions/WebAppContent' 274 | 401: 275 | $ref: '#/responses/Unauthorized' 276 | 404: 277 | $ref: '#/responses/NotFound' 278 | default: 279 | $ref: '#/responses/Error' 280 | 281 | '/webapps/{sourceId}/duplicate': 282 | post: 283 | tags: 284 | - content 285 | summary: Duplicate webapp 286 | description: Duplicate a webapp by creating new webapp metadata with the specified name and duplicating existing content into the new webapp. 287 | operationId: duplicate-webapp 288 | parameters: 289 | - in: path 290 | type: string 291 | required: true 292 | name: sourceId 293 | description: The Id of the source webapp to copy content from 294 | - $ref: '#/parameters/DuplicateWebAppRequest' 295 | responses: 296 | 200: 297 | $ref: '#/responses/CreateWebAppResponse' 298 | 401: 299 | $ref: '#/responses/Unauthorized' 300 | 404: 301 | $ref: '#/responses/NotFound' 302 | default: 303 | $ref: '#/responses/Error' 304 | '/webapps/{id}/duplicate/{sourceId}': 305 | post: 306 | tags: 307 | - content 308 | summary: Duplicate webapp content 309 | description: Duplicate webapp content 310 | operationId: duplicate-content 311 | parameters: 312 | - $ref: '#/parameters/WebAppId' 313 | - in: path 314 | type: string 315 | required: true 316 | name: sourceId 317 | description: The Id of the source webapp to copy content from 318 | responses: 319 | 200: 320 | description: Success 321 | 401: 322 | $ref: '#/responses/Unauthorized' 323 | 404: 324 | $ref: '#/responses/NotFound' 325 | default: 326 | $ref: '#/responses/Error' 327 | 328 | parameters: 329 | WebAppId: 330 | in: path 331 | name: id 332 | description: The webapp identifier 333 | type: string 334 | required: true 335 | WebAppContentPath: 336 | in: path 337 | name: path 338 | description: Path to webapp content 339 | type: string 340 | required: true 341 | CreateWebAppRequest: 342 | in: body 343 | name: CreateWebAppRequest 344 | description: Create WebApp Request 345 | schema: 346 | type: object 347 | title: Create WebApp Request 348 | properties: 349 | name: 350 | type: string 351 | description: The webapp's name 352 | example: My webapp 353 | workspace: 354 | type: string 355 | description: The workspace Id for the webapp. If this is not specified, the webapp will be created in the default workspace. 356 | example: 0c80cf49-54e9-4e92-b117-3bfa574caa84 357 | policyIds: 358 | type: array 359 | items: 360 | type: string 361 | example: "asdsad-17a6-45323-b64b-65325287372d" 362 | description: List of policy Ids associated with the webapp, which give it access to the user's resources" 363 | properties: 364 | type: object 365 | description: A map of key value properties associated with the webapp 366 | additionalProperties: 367 | type: string 368 | example: 369 | key1: value1 370 | UpdateWebAppRequest: 371 | in: body 372 | name: UpdateWebAppRequest 373 | description: Update WebApp Request 374 | schema: 375 | type: object 376 | title: Update WebApp Request 377 | properties: 378 | name: 379 | type: string 380 | description: The webapp's name 381 | example: My webapp 382 | workspace: 383 | type: string 384 | description: The workspace Id for the webapp. If this is not specified, the webapp will remain in its existing workspace. 385 | example: 0c80cf49-54e9-4e92-b117-3bfa574caa84 386 | policyIds: 387 | type: array 388 | items: 389 | type: string 390 | example: "asdsad-17a6-45323-b64b-65325287372d" 391 | description: List of policy Ids associated with the webapp, which give it access to the user's resources" 392 | properties: 393 | type: object 394 | description: A map of key value properties associated with the webapp 395 | additionalProperties: 396 | type: string 397 | example: 398 | key1: value1 399 | UpdateWebAppSharingRequest: 400 | in: body 401 | name: UpdateWebAppSharingRequest 402 | description: Update WebApp Sharing Request 403 | schema: 404 | type: object 405 | title: Update WebApp Sharing Request 406 | properties: 407 | shared: 408 | type: string 409 | enum: 410 | - private 411 | - direct 412 | - public 413 | example: direct 414 | description: The webapp's sharing option 415 | sharedEmails: 416 | type: array 417 | items: 418 | type: string 419 | example: john.doe@email.com 420 | description: List of emails of users to share the webapp with. Applies when "shared" option is "direct" 421 | ImportWebAppsRequest: 422 | in: body 423 | name: ImportWebAppsRequest 424 | description: Import WebApp Metadata Request 425 | schema: 426 | type: object 427 | title: Import WebApp Metadata Request 428 | properties: 429 | webapps: 430 | description: List of webapps to import 431 | type: array 432 | items: 433 | $ref: '#/definitions/WebApp' 434 | DuplicateWebAppRequest: 435 | in: body 436 | name: DuplicateWebAppRequest 437 | description: Duplicate WebApp Request 438 | schema: 439 | type: object 440 | title: Duplicate WebApp Request 441 | properties: 442 | name: 443 | type: string 444 | description: The name of the new webapp created during the duplication 445 | example: My webapp name 446 | workspace: 447 | type: string 448 | description: The Id of the workspace in which to create the new webapp. If no workspace is specified, the new webapp will be put in the default workspace. 449 | example: 0c80cf49-54e9-4e92-b117-3bfa574caa84 450 | 451 | responses: 452 | Error: 453 | description: Error 454 | schema: 455 | description: Error response 456 | title: ErrorResponse 457 | type: object 458 | properties: 459 | error: 460 | $ref: '#/definitions/Error' 461 | Unauthorized: 462 | description: API Key is missing or invalid 463 | NotFound: 464 | description: The resource was not found. 465 | ValidationError: 466 | description: Invalid input data 467 | GetWebAppResponse: 468 | description: Get WebApp Response 469 | schema: 470 | $ref: '#/definitions/WebApp' 471 | CreateWebAppResponse: 472 | description: Create WebApp Response 473 | schema: 474 | $ref: '#/definitions/WebApp' 475 | ImportWebAppsResponse: 476 | description: Import WebApps Response 477 | schema: 478 | title: Import WebApps Response 479 | type: object 480 | properties: 481 | webapps: 482 | description: List of webapps that were imported 483 | type: array 484 | items: 485 | $ref: '#/definitions/WebApp' 486 | UpdateWebAppResponse: 487 | description: Update WebApp Response 488 | schema: 489 | $ref: '#/definitions/WebApp' 490 | UpdateWebAppSharingResponse: 491 | description: Update WebApp Sharing Response 492 | schema: 493 | $ref: '#/definitions/WebApp' 494 | ListWebAppsResponse: 495 | description: List WebApps Response 496 | schema: 497 | title: List WebApps Response 498 | type: object 499 | properties: 500 | webapps: 501 | description: List of webapps 502 | type: array 503 | items: 504 | $ref: '#/definitions/WebApp' 505 | continuationToken: 506 | description: The continuation token can be used to paginate through the webapp list results. Provide this token in the next list webapps call. 507 | type: string 508 | example: token 509 | SharedEmailsResponse: 510 | description: Shared Emails Response 511 | schema: 512 | title: Shared Emails Response 513 | type: array 514 | items: 515 | type: string 516 | example: john.doe@email.com 517 | 518 | definitions: 519 | WebApp: 520 | type: object 521 | title: WebApp Metadata 522 | properties: 523 | id : 524 | type: string 525 | description: The webapp Id 526 | example: "asdsad-17a6-45323-b64b-65325287372d" 527 | type: 528 | type: string 529 | enum: 530 | - Dashboard 531 | - TileDashboard 532 | - DashboardTemplate 533 | - WebVI 534 | - Visualization 535 | - VisualizationTemplate 536 | description: The webapp type 537 | name: 538 | type: string 539 | description: The webapp name 540 | example: My webapp 541 | workspace: 542 | type: string 543 | description: The Id of the workspace containing the webapp 544 | example: 0c80cf49-54e9-4e92-b117-3bfa574caa84 545 | userId: 546 | type: string 547 | description: The Id of the user that created the webapp 548 | example: d4f6b766-da45-4fe5-85c5-bd745c402cf9 549 | shared: 550 | type: string 551 | enum: 552 | - private 553 | - direct 554 | - public 555 | description: The webapp's sharing option 556 | sharedEmails: 557 | type: array 558 | items: 559 | type: string 560 | example: john.doe@ni.com 561 | description: List of emails of users to share the webapp with. Applies when "shared" option is "direct" 562 | policyIds: 563 | type: array 564 | items: 565 | type: string 566 | example: asdsad-17a6-45323-b64b-65325287372d 567 | description: List of policy Ids associated with the webapp, which give it access to the user's resources" 568 | created: 569 | type: string 570 | format: date-time 571 | description: The created timestamp (iso8601 format) 572 | example: "2019-12-02T15:31:45.379Z" 573 | updated: 574 | type: string 575 | format: date-time 576 | description: The last updated timestamp (iso8601 format) 577 | example: "2019-12-02T15:31:45.379Z" 578 | properties: 579 | type: object 580 | description: A map of key value properties associated with the webapp 581 | WebAppContent: 582 | type: string 583 | format: binary 584 | title: WebApp Content 585 | description: The webapp binary content. Depending on the webapp's type it can be a dashboard, template or *.nipkg file exported from LabVIEW NXG 586 | WebAppsAdvancedQuery: 587 | type: object 588 | title: Advanced Query Object for WebApps 589 | properties: 590 | filter: 591 | description: >- 592 | The filter criteria for webapps, consisting of a string of queries composed using AND/OR operators. 593 | String values need to be enclosed in double quotes. 594 | Parenthesis can be used within the filter to better define the order of operations. 595 | 596 | 597 | Filter syntax: '[property name][operator][operand] and [property name][operator][operand]' 598 | 599 | Operators: 600 | 601 | - Equals operator '='. Example: 'x = y' 602 | 603 | - Not equal operator '!='. Example: 'x != y' 604 | 605 | - Greater than operator '>'. Example: 'x > y' 606 | 607 | - Greater than or equal operator '>='. Example: 'x >= y' 608 | 609 | - Less than operator '<'. Example: 'x < y' 610 | 611 | - Less than or equal operator '<='. Example: 'x <= y' 612 | 613 | - Logical AND operator 'and'. Example: 'x and y' 614 | 615 | - Logical OR operator 'or'. Example: 'x or y' 616 | 617 | - Starts with operator '.StartsWith()', used to check whether a string starts with another string. Example: 'x.StartsWith(y)' 618 | 619 | - Does not start with operator '!.StartsWith()', used to check whether a string does not start with another string. Example: '!x.StartsWith(y)' 620 | 621 | - String null or empty 'string.IsNullOrEmpty()', used to check whether a string is null or empty. Example: 'string.IsNullOrEmpty(x)' 622 | 623 | - String is not null or empty '!string.IsNullOrEmpty()', used to check whether a string is not null or empty. Example: '!string.IsNullOrEmpty(x)' 624 | 625 | 626 | Valid webapp properties that can be used in the filter: 627 | 628 | - id 629 | 630 | - name 631 | 632 | - properties.embedLocation 633 | 634 | - shared 635 | 636 | - type 637 | 638 | - workspace 639 | type: string 640 | example: name.StartsWith("myWebApp") || type == "WebVI" 641 | take: 642 | description: The maximum number of webapps to return 643 | type: integer 644 | default: 100 645 | minimum: 0 646 | maximum: 1000 647 | example: 10 648 | continuationToken: 649 | description: The continuation token can be used to paginate through the webapp query results. Provide this token in the next query webapps call. 650 | type: string 651 | example: token 652 | Error: 653 | description: Contains error information 654 | type: object 655 | properties: 656 | name: 657 | description: String error code 658 | type: string 659 | code: 660 | description: Numeric error code 661 | type: integer 662 | message: 663 | description: Complete error message 664 | type: string 665 | args: 666 | description: Positional argument values for the error code 667 | type: array 668 | items: 669 | type: string 670 | innerErrors: 671 | type: array 672 | items: 673 | $ref: '#/definitions/Error' 674 | example: 675 | name: Skyline.OneOrMoreErrorsOccurred 676 | code: -251041 677 | message: >- 678 | One or more errors occurred. See the contained list for details of each 679 | error. 680 | args: [] 681 | innerErrors: 682 | - name: DocumentManager.NotFound 683 | code: -252520 684 | message: The specified document was not found. 685 | args: [] -------------------------------------------------------------------------------- /tdm-reader/nitdmreader.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: TDMReader Web Service 5 | description: TDMReader HTTP API 6 | contact: 7 | name: NI 8 | url: 'https://www.ni.com/systemlink' 9 | email: support@ni.com 10 | basePath: /nitdmreader 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | securityDefinitions: 16 | apiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | basicAuth: 21 | type: basic 22 | cookieAuth: 23 | type: apiKey 24 | in: header 25 | name: Cookie 26 | security: 27 | - apiKeyAuth: [] 28 | - basicAuth: [] 29 | - cookieAuth: [] 30 | x-ni-routing-key: Skyline.TDMReader 31 | definitions: 32 | Error: 33 | description: Contains error information 34 | type: object 35 | properties: 36 | name: 37 | description: String error code 38 | type: string 39 | code: 40 | description: Numeric error code 41 | type: integer 42 | resourceType: 43 | description: Type of resource associated with the error 44 | type: string 45 | resourceId: 46 | description: Identifier of the resource associated with the error 47 | type: string 48 | message: 49 | description: Complete error message 50 | type: string 51 | args: 52 | description: Positional argument values for the error code 53 | type: array 54 | items: 55 | type: string 56 | innerErrors: 57 | type: array 58 | items: 59 | $ref: '#/definitions/Error' 60 | example: 61 | name: Skyline.OneOrMoreErrorsOccurred 62 | code: -251040 63 | message: >- 64 | One or more errors occurred. See the contained list for details about each 65 | error. 66 | args: [] 67 | innerErrors: 68 | - name: TDMReader.FileServiceFailed 69 | code: -253500 70 | resourceType: File 71 | resourceId: 4afb2ce3741fe11d88838cc9 72 | message: File service failed. 73 | args: [] 74 | Operation: 75 | description: Operation provided by the API 76 | type: object 77 | properties: 78 | available: 79 | type: boolean 80 | description: Whether the operation is available to the caller 81 | version: 82 | type: integer 83 | description: The version of the available operation 84 | required: [available] 85 | example: 86 | available: true 87 | version: 1 88 | V1Operations: 89 | description: V1 operations 90 | type: object 91 | properties: 92 | operations: 93 | description: >- 94 | Available operations in the v1 version of the API: 95 | 96 | - readData: Ability to read data 97 | type: object 98 | properties: 99 | readData: 100 | $ref: '#/definitions/Operation' 101 | Property: 102 | description: A property and its value. 103 | type: object 104 | properties: 105 | name: 106 | type: string 107 | description: Name of the property 108 | example: Name 109 | type: 110 | type: string 111 | description: Data type of 'value' 112 | example: String 113 | value: 114 | type: string 115 | example: Channel name 116 | Properties: 117 | type: object 118 | properties: 119 | properties: 120 | description: Property values 121 | type: array 122 | items: 123 | $ref: '#/definitions/Property' 124 | totalCount: 125 | type: integer 126 | description: Count of all properties. This might be more than the items returned in Properties. 127 | example: 1 128 | FileList: 129 | type: object 130 | properties: 131 | fileIds: 132 | description: File IDs 133 | type: array 134 | items: 135 | type: string 136 | example: 5b8453dba8808c22b0f99023 137 | DataWindow: 138 | description: Data window. 139 | properties: 140 | decimatex: 141 | type: integer 142 | description: Number of values on the x axis. This determines the number of points that can be displayed. 143 | example: 1000 144 | default: null 145 | format: int32 146 | decimatey: 147 | type: integer 148 | description: Number of values on the y axis. This determines the number of points that can be displayed. 149 | example: 1000 150 | default: null 151 | format: int32 152 | xmin: 153 | type: number 154 | default: null 155 | format: double 156 | description: Minimum x value of the display x axis. 157 | example: -1 158 | xmax: 159 | type: number 160 | default: null 161 | format: double 162 | description: Maximum x value of the display x axis. 163 | example: 1 164 | ymin: 165 | type: number 166 | default: null 167 | format: double 168 | description: Minimum y value of the display y axis. 169 | example: -1 170 | ymax: 171 | type: number 172 | default: null 173 | format: double 174 | description: Maximum y value of the display y axis. 175 | example: 1 176 | xlog: 177 | type: boolean 178 | default: false 179 | description: Logrithmic X channel. 180 | ylog: 181 | type: boolean 182 | default: false 183 | description: Logrithmic Y channel. 184 | showLines: 185 | type: boolean 186 | description: Represent data as lines. When decimation is performed, the data returned represents the min and max values for that x-axis increment. 187 | default: true 188 | showPoints: 189 | type: boolean 190 | default: false 191 | description: Represent data as points. When decimation is performed, the data returned represents all the points in that x-axis increment. 192 | filter: 193 | type: string 194 | default: null 195 | description: Expression to apply to a group of channels. Valid variables are x, y0-yn, f0-fn (optional filterChannels). 196 | example: (x > 0) and (y0 = 1) 197 | filterChannels: 198 | type: array 199 | items: 200 | $ref: '#/definitions/OneChannelSpecifier' 201 | default: null 202 | description: Channels to use only to filter. Values from these channels are not returned. 203 | function: 204 | type: string 205 | default: null 206 | description: Function to perform on the channel data. 207 | example: y0-y1 208 | outputObjectNames: 209 | type: array 210 | items: 211 | type: string 212 | default: null 213 | description: Transpose the returned data for the channels with the specified names. 214 | example: 215 | - name1 216 | - name2 217 | xminStringData: 218 | description: >- 219 | ISO-8601 formatted timestamp indicating the starting point for x data 220 | type: string 221 | example: '2018-05-09T15:07:42.527921Z' 222 | xmaxStringData: 223 | description: >- 224 | ISO-8601 formatted timestamp indicating the ending point for x data 225 | type: string 226 | example: '2018-05-09T15:07:42.527921Z' 227 | sort: 228 | type: string 229 | default: null 230 | description: Specify how to sort values before returning them. 231 | example: '-y0,x,s0' 232 | sortChannels: 233 | type: array 234 | items: 235 | $ref: '#/definitions/OneChannelSpecifier' 236 | default: null 237 | description: Channels to use only to sort. Values from these channels are not returned. 238 | useWaveformProperties: 239 | type: boolean 240 | description: Look for specific properties in a channel that define the start and increment x values to use for each channel. 241 | default: false 242 | groupBy: 243 | type: string 244 | description: List of channels to group by. 245 | default: null 246 | example: 'y0,x' 247 | groupStride: 248 | type: integer 249 | description: Number of samples per group. 250 | default: null 251 | format: int32 252 | example: 100 253 | groupChannels: 254 | type: array 255 | items: 256 | $ref: '#/definitions/OneChannelSpecifier' 257 | default: null 258 | description: Channels to use only to group. Values from these channels are not returned. 259 | maxGroupsToReturn: 260 | type: integer 261 | default: null 262 | format: int32 263 | description: Maximum number of groups to return when grouping. 264 | example: 100 265 | groupItemIndexStart: 266 | type: integer 267 | default: null 268 | format: int32 269 | description: Index of first item in each group to return. 270 | example: 100 271 | groupItemMaxCount: 272 | type: integer 273 | default: null 274 | format: int32 275 | description: Maximum number of items to return per group. 276 | example: 100 277 | ignoreXForDecimation: 278 | type: boolean 279 | default: null 280 | description: If true, x is not used in decimation. Instead, indices are returend for x. 281 | example: true 282 | OneChannelSpecifier: 283 | description: Specification for a channel of data 284 | properties: 285 | fileId: 286 | description: file descriptor 287 | type: string 288 | example: "5b8453dba8808c22b0f99023" 289 | groupName: 290 | type: string 291 | description: group name 292 | example: Group 1 293 | channelName: 294 | type: string 295 | description: channel name 296 | example: Channel 1 297 | required: 298 | - fileId 299 | ChannelSpecifications: 300 | description: Array of x-y channel groups. The x channel of each grouping is optional. 301 | properties: 302 | xyChannels: 303 | type: array 304 | items: 305 | description: y channel(s) and an optional x channel 306 | properties: 307 | xChannel: 308 | $ref: '#/definitions/OneChannelSpecifier' 309 | yChannels: 310 | description: 'Channels to be treated as y channels associated with x channel' 311 | type: array 312 | items: 313 | $ref: '#/definitions/OneChannelSpecifier' 314 | dataWindow: 315 | $ref: '#/definitions/DataWindow' 316 | required: 317 | - yChannels 318 | minItems: 1 319 | required: 320 | - xyChannels 321 | QueryChannelsRequest: 322 | description: Object containing the channels to request metadata for. 323 | properties: 324 | channelSpecifications: 325 | type: array 326 | items: 327 | $ref: '#/definitions/OneChannelSpecifier' 328 | calculateChannelLength: 329 | type: boolean 330 | description: Determines whether or not to calculate the channel length 331 | default: false 332 | required: 333 | - channelSpecifications 334 | OneChannelData: 335 | properties: 336 | dataType: 337 | type: string 338 | description: Native data type for the channel 339 | numericData: 340 | type: array 341 | description: Channel data 342 | items: 343 | type: number 344 | stringData: 345 | type: array 346 | description: Channel data 347 | items: 348 | type: string 349 | decimated: 350 | type: boolean 351 | description: Specifies whether returned data is decimated 352 | lossyDecimation: 353 | type: boolean 354 | description: Specifies whether data was decimated in a lossy manner such that the returned data is not necessarily a true visual representation 355 | undecimatedLength: 356 | type: integer 357 | description: Number of points of undecimated data 358 | XYData: 359 | properties: 360 | x: 361 | $ref: '#/definitions/OneChannelData' 362 | 'y': 363 | type: array 364 | description: Array of y channels 365 | items: 366 | $ref: '#/definitions/OneChannelData' 367 | ReturnedXYData: 368 | properties: 369 | data: 370 | type: array 371 | description: Pairing of data from an x channel and multiple y channels 372 | items: 373 | $ref: '#/definitions/XYData' 374 | timeUtcOffsetHours: 375 | type: number 376 | description: Time zone offset applied to local time values 377 | error: 378 | $ref: '#/definitions/Error' 379 | QueryDataSpecifier: 380 | properties: 381 | channelSpecifications: 382 | $ref: '#/definitions/ChannelSpecifications' 383 | required: 384 | - channelSpecifications 385 | CreateCalculatedResultSpecifier: 386 | properties: 387 | channelSpecifications: 388 | $ref: '#/definitions/ChannelSpecifications' 389 | workspaceId: 390 | type: string 391 | required: 392 | - channelSpecifications 393 | ReturnedUniqueValues: 394 | properties: 395 | uniqueValues: 396 | type: array 397 | items: 398 | $ref: '#/definitions/OneChannelData' 399 | timeUtcOffsetHours: 400 | type: number 401 | description: Time zone offset applied to local time values 402 | example: 0 403 | UniqueValuesSpecifier: 404 | properties: 405 | channelSpecifications: 406 | type: array 407 | description: Channel specifications 408 | items: 409 | $ref: '#/definitions/OneChannelSpecifier' 410 | maxNumberOfUniqueValues: 411 | description: Maximum number of unique values to identify 412 | type: integer 413 | example: 10 414 | NamesList: 415 | description: List of names and number of names 416 | properties: 417 | names: 418 | description: All names 419 | type: array 420 | items: 421 | type: string 422 | description: Name 423 | example: Channel 1 424 | totalCount: 425 | type: integer 426 | description: Total number of names. This might be more than the number of names in the list. 427 | example: 1 428 | FileInformation: 429 | type: object 430 | properties: 431 | fileId: 432 | type: string 433 | description: File ID 434 | example: "5b8453dba8808c22b0f99023" 435 | properties: 436 | $ref: '#/definitions/Properties' 437 | groups: 438 | type: array 439 | items: 440 | properties: 441 | name: 442 | type: string 443 | description: Group name 444 | example: Group 1 445 | properties: 446 | $ref: '#/definitions/Properties' 447 | channels: 448 | type: array 449 | items: 450 | properties: 451 | name: 452 | type: string 453 | description: Channel name 454 | example: Channel 1 455 | dataCount: 456 | type: number 457 | description: Number of data points in the channel 458 | example: 1 459 | dataType: 460 | type: string 461 | description: Data type of this channel 462 | example: String 463 | properties: 464 | $ref: '#/definitions/Properties' 465 | FileInformationList: 466 | type: array 467 | items: 468 | $ref: '#/definitions/FileInformation' 469 | paths: 470 | /: 471 | get: 472 | tags: [versioning] 473 | summary: API information 474 | description: Returns information about API versions and available operations. 475 | operationId: RootEndpoint 476 | security: [] 477 | responses: 478 | 200: 479 | description: OK 480 | schema: 481 | description: Version information 482 | title: RootEndpointResponse 483 | type: object 484 | properties: 485 | v1: 486 | $ref: '#/definitions/V1Operations' 487 | version: 488 | description: Implementation version of the web service 489 | type: string 490 | example: '18.0' 491 | /{version}: 492 | parameters: 493 | - in: path 494 | name: version 495 | description: Version of the API to retrieve operations 496 | type: string 497 | required: true 498 | get: 499 | tags: [versioning] 500 | summary: API version information 501 | description: Returns available operations for a single version of the API. 502 | operationId: RootEndpointWithVersion 503 | security: [] 504 | responses: 505 | 200: 506 | description: OK 507 | schema: 508 | $ref: '#/definitions/V1Operations' 509 | 404: 510 | description: Not Found 511 | schema: 512 | $ref: '#/definitions/Error' 513 | /v1/files/{fileId}: 514 | get: 515 | tags: [metadata] 516 | summary: Gets file, group, and channel information 517 | description: 'Gets all group names, channel names, channel information, and properties at all levels. This does not return channel data.' 518 | operationId: getAllFileInfo 519 | x-ni-auth: true 520 | x-ni-request-variables: [REMOTE_USER] 521 | x-ni-request-timeout: 60000 522 | produces: 523 | - application/json 524 | parameters: 525 | - name: fileId 526 | description: File ID 527 | in: path 528 | type: string 529 | required: true 530 | responses: 531 | 200: 532 | description: OK 533 | schema: 534 | $ref: '#/definitions/FileInformation' 535 | default: 536 | description: Error 537 | schema: 538 | $ref: '#/definitions/Error' 539 | /v1/query-files: 540 | post: 541 | tags: [metadata] 542 | summary: Gets file, group, and channel information 543 | description: 'Gets all group names, channel names, channel information, and properties at all levels. This does not return channel data.' 544 | operationId: getMultipleFileInfo 545 | x-ni-auth: true 546 | x-ni-request-variables: [REMOTE_USER] 547 | x-ni-request-timeout: 60000 548 | produces: 549 | - application/json 550 | parameters: 551 | - name: fileIds 552 | description: List of File IDs to inspect 553 | in: body 554 | required: true 555 | schema: 556 | $ref: '#/definitions/FileList' 557 | responses: 558 | 200: 559 | description: OK 560 | schema: 561 | $ref: '#/definitions/FileInformationList' 562 | default: 563 | description: Error 564 | schema: 565 | $ref: '#/definitions/Error' 566 | /v1/query-channels: 567 | post: 568 | tags: [metadata] 569 | summary: Gets channel information 570 | description: 'Gets all channel names, channel information, and properties for the channel. This does not return channel data.' 571 | operationId: queryChannels 572 | x-ni-auth: true 573 | x-ni-request-variables: [REMOTE_USER] 574 | x-ni-request-timeout: 60000 575 | produces: 576 | - application/json 577 | parameters: 578 | - name: QueryChannelsRequest 579 | description: Channel request parameters 580 | in: body 581 | required: true 582 | schema: 583 | $ref: '#/definitions/QueryChannelsRequest' 584 | responses: 585 | 200: 586 | description: OK 587 | schema: 588 | $ref: '#/definitions/FileInformationList' 589 | default: 590 | description: Error 591 | schema: 592 | $ref: '#/definitions/Error' 593 | /v1/files/{fileId}/groups: 594 | get: 595 | tags: [metadata] 596 | summary: Lists all groups in the file 597 | description: Lists all group names in the file. 598 | operationId: getGroups 599 | x-ni-auth: true 600 | x-ni-request-variables: [REMOTE_USER] 601 | x-ni-request-timeout: 60000 602 | produces: 603 | - application/json 604 | parameters: 605 | - name: fileId 606 | description: File ID 607 | in: path 608 | required: true 609 | type: string 610 | - name: skip 611 | description: Number of items to skip 612 | in: query 613 | type: integer 614 | default: 0 615 | - name: take 616 | description: Number of items to take after skipping 617 | in: query 618 | type: integer 619 | default: -1 620 | - name: returnCount 621 | description: Specifies whether to return the total number of items 622 | in: query 623 | type: boolean 624 | default: false 625 | responses: 626 | 200: 627 | description: OK 628 | schema: 629 | $ref: '#/definitions/NamesList' 630 | default: 631 | description: Error 632 | schema: 633 | $ref: '#/definitions/Error' 634 | /v1/files/{fileId}/groups/{groupName}/channels: 635 | get: 636 | tags: [metadata] 637 | summary: Lists all channels in the group 638 | description: Lists all channel names for a group in a specific file. 639 | operationId: getChannels 640 | x-ni-auth: true 641 | x-ni-request-variables: [REMOTE_USER] 642 | x-ni-request-timeout: 60000 643 | produces: 644 | - application/json 645 | parameters: 646 | - name: fileId 647 | description: File ID 648 | in: path 649 | required: true 650 | type: string 651 | - name: groupName 652 | description: Group name 653 | in: path 654 | required: true 655 | type: string 656 | - name: skip 657 | description: Number of items to skip 658 | in: query 659 | type: integer 660 | default: 0 661 | - name: take 662 | description: Number of items to take after skipping 663 | in: query 664 | type: integer 665 | default: -1 666 | - name: returnCount 667 | description: Specify this to return the total count of items 668 | in: query 669 | type: boolean 670 | default: false 671 | responses: 672 | 200: 673 | description: OK 674 | schema: 675 | $ref: '#/definitions/NamesList' 676 | default: 677 | description: Error 678 | schema: 679 | $ref: '#/definitions/Error' 680 | /v1/query-data: 681 | post: 682 | tags: [data] 683 | summary: Returns data from channels. 684 | description: Queries files based on channel and window specifications and returns channel data that matches the query. The channel specifications select channels by group and channel relationships. Window specifications determine a bounding box of minimum and maximum x and y values, as well as specify the type of decimation performed on data within the window. 685 | operationId: queryData 686 | x-ni-auth: true 687 | x-ni-request-variables: [REMOTE_USER] 688 | x-ni-request-timeout: 60000 689 | produces: 690 | - application/json 691 | parameters: 692 | - name: ChannelSpecifications 693 | description: Channel specifications and window information 694 | in: body 695 | required: true 696 | schema: 697 | $ref: '#/definitions/QueryDataSpecifier' 698 | responses: 699 | 200: 700 | description: OK 701 | schema: 702 | $ref: '#/definitions/ReturnedXYData' 703 | default: 704 | description: Error 705 | schema: 706 | $ref: '#/definitions/Error' 707 | /v1/query-unique-values: 708 | post: 709 | tags: [data] 710 | summary: Returns unique data from channels. 711 | description: Queries files based on channel specifications and returns unique channel data values. The channel specifications select channels by group and channel relationships. The maximum number of unique values to return is determined by MaxNumberOfUniqueValues. If there are more unique values, then the first MaxNumberOfUniqueValues + 1 values are returned. 712 | operationId: queryUniqueValues 713 | x-ni-auth: true 714 | x-ni-request-variables: [REMOTE_USER] 715 | x-ni-request-timeout: 60000 716 | produces: 717 | - application/json 718 | parameters: 719 | - name: ChannelSpecifications 720 | description: Channel specifications 721 | in: body 722 | required: true 723 | schema: 724 | $ref: '#/definitions/UniqueValuesSpecifier' 725 | responses: 726 | 200: 727 | description: OK 728 | schema: 729 | $ref: '#/definitions/ReturnedUniqueValues' 730 | default: 731 | description: Error 732 | schema: 733 | $ref: '#/definitions/Error' 734 | /v1/create-calculated-result: 735 | post: 736 | tags: [data] 737 | summary: Returns a calculated result channel. 738 | description: Creates a channel based on values from other channels. 739 | operationId: createCalculatedResult 740 | x-ni-auth: true 741 | x-ni-request-variables: [REMOTE_USER] 742 | x-ni-request-timeout: 60000 743 | produces: 744 | - application/json 745 | parameters: 746 | - name: ChannelSpecifications 747 | description: Channel specifications and window information 748 | in: body 749 | required: true 750 | schema: 751 | $ref: '#/definitions/CreateCalculatedResultSpecifier' 752 | responses: 753 | 200: 754 | description: OK 755 | schema: 756 | $ref: '#/definitions/ReturnedUniqueValues' 757 | default: 758 | description: Error 759 | schema: 760 | $ref: '#/definitions/Error' -------------------------------------------------------------------------------- /tag-rule/nitagrule.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: Tag Rule Engine Web Service 5 | description: SystemLink Tag Rule Engine Service HTTP API. Only available on SystemLink Server. 6 | contact: 7 | name: NI 8 | url: 'https://www.ni.com/systemlink' 9 | email: support@ni.com 10 | basePath: /nitagrule 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | securityDefinitions: 16 | apiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | basicAuth: 21 | type: basic 22 | security: 23 | - apiKeyAuth: [] 24 | - basicAuth: [] 25 | x-ni-routing-key: Skyline.TagRuleEngine 26 | definitions: 27 | Error: 28 | description: Contains error information 29 | type: object 30 | properties: 31 | name: 32 | description: String error code 33 | type: string 34 | code: 35 | description: Numeric error code 36 | type: integer 37 | message: 38 | description: Complete error message 39 | type: string 40 | args: 41 | description: Positional argument values for the error code 42 | type: array 43 | items: 44 | type: string 45 | resourceType: 46 | description: Type of resource associated with the error. 47 | This field is only present for entries in *innerErrors*. 48 | type: string 49 | enum: [tagRule] 50 | resourceId: 51 | description: Identifier of the resource associated with the error. 52 | This field is only present for entries in *innerErrors*. 53 | type: string 54 | innerErrors: 55 | description: Array of individual errors when a request results in multiple errors. 56 | This field is only present when *name* is 'Skyline.OneOrMoreErrorsOccurred'. 57 | type: array 58 | items: 59 | $ref: '#/definitions/Error' 60 | example: 61 | name: Skyline.OneOrMoreErrorsOccurred 62 | code: -251041 63 | message: One or more errors occurred. See the contained list for details of each error. 64 | args: [] 65 | innerErrors: 66 | - name: TagRuleEngine.RuleNotFound 67 | code: -253103 68 | message: A rule with ID '5c2cf7e0e0d64403b486fcb4' was not found. 69 | resourceType: tagRule 70 | resourceId: 5c2cf7e0e0d64403b486fcb4 71 | args: [5c2cf7e0e0d64403b486fcb4] 72 | Operation: 73 | description: Operation provided by the API 74 | type: object 75 | properties: 76 | available: 77 | type: boolean 78 | description: Whether the operation is available to the caller 79 | version: 80 | type: integer 81 | description: Version of the available operation 82 | required: [available] 83 | example: 84 | available: true 85 | version: 1 86 | V1Operations: 87 | title: V1 Operations 88 | description: V1 operations 89 | type: object 90 | properties: 91 | operations: 92 | description: >- 93 | Available operations in the v1 version of the API: 94 | 95 | - deleteRules: The ability to delete tag alarm rules 96 | 97 | - readRules: The ability to query for tag alarm rules 98 | 99 | - writeRules: The ability to create and modify tag alarm rules 100 | 101 | type: object 102 | properties: 103 | deleteRules: 104 | $ref: '#/definitions/Operation' 105 | readRules: 106 | $ref: '#/definitions/Operation' 107 | writeRules: 108 | $ref: '#/definitions/Operation' 109 | Condition: 110 | title: Condition 111 | description: An object describing the circumstances under which an alarm should be created. 112 | type: object 113 | required: 114 | - setPoints 115 | - comparator 116 | properties: 117 | setPoints: 118 | description: Values compared against the tag's current value to determine whether or not the condition 119 | is true. Conditions associated with the IN_RANGE and OUT_OF_RANGE comparators will have two set 120 | points. All other conditions should have only one set point. For tags of the DATE_TIME type, a timespan 121 | (for example, "01:00:00") is a valid value and represents a time interval relative to the server's current 122 | time when the rule is evaluated. Positive timespans represent times in the future, and negative timespans 123 | represent times in the past. The expected timespan format is `[-]d.hh:mm:ss.ff`. 124 | type: array 125 | items: 126 | type: string 127 | example: ["10"] 128 | comparator: 129 | type: string 130 | description: Operator which will be used when comparing the tag's current value to the set point(s). 131 | Note that the CONTAINS and NOT_CONTAINS comparators are only valid for rules associated with 132 | string tags. Similarly, LESS_THAN, GREATER_THAN, IN_RANGE, and the other numeric comparators are 133 | not valid for rules associated with string tags. 134 | enum: [LESS_THAN, LESS_THAN_OR_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, IN_RANGE, OUT_OF_RANGE, 135 | EQUAL, NOT_EQUAL, CONTAINS, NOT_CONTAINS] 136 | deadband: 137 | description: The change in signal from the set point necessary to clear an alarm. For example, a 138 | condition with a set point of 10, a comparator of GREATER_THAN, and a deadband of 2 will request 139 | that alarms be cleared if the tag's values is less than or equal to (10 - 2) = 8. Similarly, if the 140 | condition had a comparator of LESS_THAN, the condition would request that alarms be cleared if the 141 | tag's value is greater than or equal to (10 + 2) = 12. 142 | type: string 143 | example: '2' 144 | severityLevel: 145 | description: An integer in the range [1,4] which specifies the severity level of a condition. 146 | Higher numeric values correspond to higher severity levels. 147 | type: integer 148 | minimum: 1 149 | maximum: 4 150 | example: 2 151 | default: 2 152 | notificationStrategyIds: 153 | description: The IDs of the notification strategies which should be triggered if a condition 154 | results in alarms being created or increasing in severity. 155 | type: array 156 | items: 157 | type: string 158 | example: [] 159 | TagDataType: 160 | title: Tag Data Type 161 | description: The data type of the tags which a rule applies to. Rules are only evaluated 162 | against tags whose data type matches their *tagDataType*. For the TAG_TIME type, rules are 163 | evaluated against a tag's last updated time rather than its value. These rules will match tags 164 | of any data type. 165 | type: string 166 | enum: [DOUBLE, INT, STRING, BOOLEAN, U_INT64, DATE_TIME, TAG_TIME] 167 | example: DOUBLE 168 | Conditions: 169 | description: Array containing one or more conditions which control when a rule creates or clears alarms. 170 | type: array 171 | items: 172 | $ref: '#/definitions/Condition' 173 | Keywords: 174 | description: Words or phrases associated with a rule. Rules can be tagged with keywords to make it easier 175 | to find them with queries. 176 | type: array 177 | items: 178 | type: string 179 | example: 180 | - keyword1 181 | - keyword2 182 | Properties: 183 | description: Key-value-pair metadata associated with a rule. Rules can be tagged with properties to make 184 | it easier to find them with queries. 185 | type: object 186 | additionalProperties: 187 | type: string 188 | example: 189 | key1: value1 190 | RuleCommonFields: 191 | title: Rule Common Fields 192 | description: A single-sourced definition of available fields in both an update request and the rule type 193 | itself. 194 | properties: 195 | searchPath: 196 | description: A string describing which tag(s) a rule applies to. This can take the form of either 197 | a single tag's path, or a string containing wildcard characters which can match multiple tags. 198 | type: string 199 | example: '*.System.Health.DiskUsePercentage' 200 | workspace: 201 | description: The ID of the workspace to which this rule belongs. Added in version 2 of the 202 | readRules operation. 203 | type: string 204 | example: 3d411024-9db8-42d1-8ab8-6cee0e6cd841 205 | tagDataType: 206 | $ref: '#/definitions/TagDataType' 207 | conditions: 208 | $ref: '#/definitions/Conditions' 209 | disabled: 210 | description: A value indicating whether or not a rule is disabled. 211 | type: boolean 212 | example: false 213 | default: false 214 | displayName: 215 | description: Display string for a rule's name. 216 | type: string 217 | example: Low Disk Space Rule 218 | description: 219 | description: Display string for a rule's description. 220 | type: string 221 | example: Preconfigured rule for monitoring managed system's disk space 222 | alarmInstanceDisplayNameTemplate: 223 | description: Template string which will be used to set the *displayName* field on alarms created 224 | by a rule. Values surrounded by angle brackets will be substituted with values from the tag's property 225 | dictionary. For example, if an *alarmInstanceDisplayNameTemplate* contained the string "Excessive vibration 226 | on turbine ", and the rule was evaluated against a tag whose property dictionary 227 | contained the key "turbine_number" with value "5", then the rule would request that an alarm with 228 | display name "Excessive vibration on turbine 5" be created. 229 | example: Excessive vibration on turbine 230 | type: string 231 | alarmInstanceDescriptionTemplate: 232 | description: Template string which will be used to set the *description* field on alarms created by a rule. 233 | Values surrounded by angle brackets will be substituted with values from the tag's property dictionary. 234 | See the description of AlarmInstanceDisplayNameTemplate for more information. 235 | example: Disk space on is low. Disk usage was % when this alarm was triggered. 236 | type: string 237 | keywords: 238 | $ref: '#/definitions/Keywords' 239 | properties: 240 | $ref: '#/definitions/Properties' 241 | Rule: 242 | title: Rule 243 | description: A rule which contains one or more conditions which will be evaluated against updates 244 | to tags matched by the rule's searchPath. 245 | allOf: 246 | - type: object 247 | properties: 248 | id: 249 | description: The unique ID of a particular rule. 250 | type: string 251 | example: 5c33c212e0d6444320d9a9f4 252 | - $ref: '#/definitions/RuleCommonFields' 253 | responses: 254 | Error: 255 | description: Error 256 | schema: 257 | description: Error response 258 | title: ErrorResponse 259 | type: object 260 | properties: 261 | error: 262 | $ref: '#/definitions/Error' 263 | Unauthorized: 264 | description: Not authorized 265 | headers: 266 | WWW_Authenticate: 267 | description: Information for how to authenticate 268 | type: string 269 | paths: 270 | /: 271 | get: 272 | tags: [versioning] 273 | summary: API information 274 | description: Returns information about API versions and available operations. 275 | operationId: RootEndpoint 276 | # Explicitly mark security as an empty array - this route does not require any privileges. 277 | # Marking it this way prevents it from inheriting the top-level security settings. 278 | security: [] 279 | responses: 280 | 200: 281 | description: OK 282 | schema: 283 | description: Version information 284 | title: RootEndpointResponse 285 | type: object 286 | properties: 287 | v1: 288 | $ref: '#/definitions/V1Operations' 289 | version: 290 | description: Implementation version of the web service 291 | type: string 292 | example: 18.0 293 | /{version}: 294 | parameters: 295 | - in: path 296 | name: version 297 | description: Version of the API to retrieve operations. 298 | type: string 299 | required: true 300 | get: 301 | tags: [versioning] 302 | summary: API version information 303 | description: Returns available operations for a single version of the API. 304 | operationId: RootEndpointWithVersion 305 | # Explicitly mark security as an empty array - this route does not require any privileges. 306 | # Marking it this way prevents it from inheriting the top-level security settings. 307 | security: [] 308 | responses: 309 | 200: 310 | description: OK 311 | schema: 312 | $ref: '#/definitions/V1Operations' 313 | 404: 314 | description: Not Found 315 | schema: 316 | $ref: '#/definitions/Error' 317 | /v1/rules: 318 | post: 319 | tags: [rules] 320 | summary: Create a rule 321 | description: Creates a rule. 322 | operationId: CreateRule 323 | x-ni-operation: writeRules 324 | parameters: 325 | - in: body 326 | name: Request body 327 | required: true 328 | schema: 329 | type: object 330 | title: CreateRuleRequestBody 331 | required: 332 | - searchPath 333 | - tagDataType 334 | - conditions 335 | properties: 336 | searchPath: 337 | description: A string describing which tag(s) a rule applies to. This can take the form of either 338 | a single tag's path, or a string containing wildcard characters which can match multiple tags. 339 | type: string 340 | example: '*.System.Health.DiskUsePercentage' 341 | workspace: 342 | description: The ID of the workspace in which to create or update the rule. When not specified, 343 | the default workspace is used based on the requesting user. Added in version 2 of the 344 | writeRules operation. 345 | type: string 346 | example: 3d411024-9db8-42d1-8ab8-6cee0e6cd841 347 | tagDataType: 348 | $ref: '#/definitions/TagDataType' 349 | conditions: 350 | $ref: '#/definitions/Conditions' 351 | disabled: 352 | description: A value indicating whether or not a rule is disabled. 353 | type: boolean 354 | example: false 355 | default: false 356 | displayName: 357 | description: Display string for a rule's name. 358 | type: string 359 | example: Low Disk Space Rule 360 | description: 361 | description: Display string for a rule's description. 362 | type: string 363 | example: Preconfigured rule for monitoring managed system's disk space 364 | alarmInstanceDisplayNameTemplate: 365 | description: Template string which will be used to set the *displayName* field on alarms created 366 | by a rule. Values surrounded by angle brackets will be substituted with values from the tag's property 367 | dictionary. For example, if an *alarmInstanceDisplayNameTemplate* contained the string "Excessive vibration 368 | on turbine ", and the rule was evaluated against a tag whose property dictionary 369 | contained the key "turbine_number" with value "5", then the rule would request that an alarm with 370 | display name "Excessive vibration on turbine 5" be created. 371 | example: Excessive vibration on turbine 372 | type: string 373 | alarmInstanceDescriptionTemplate: 374 | description: Template string which will be used to set the *description* field on alarms created by a rule. 375 | Values surrounded by angle brackets will be substituted with values from the tag's property dictionary. 376 | See the description of AlarmInstanceDisplayNameTemplate for more information. 377 | example: Disk space on is low. Disk usage was % when this alarm was triggered. 378 | type: string 379 | keywords: 380 | $ref: '#/definitions/Keywords' 381 | properties: 382 | $ref: '#/definitions/Properties' 383 | responses: 384 | 200: 385 | description: OK 386 | schema: 387 | type: object 388 | title: CreateRuleResponse 389 | properties: 390 | id: 391 | description: The unique ID of the created rule 392 | type: string 393 | example: 5c40ec55e0d6441168b4c543 394 | 401: 395 | $ref: '#/responses/Unauthorized' 396 | default: 397 | $ref: '#/responses/Error' 398 | /v1/rules/{id}: 399 | parameters: 400 | - in: path 401 | name: id 402 | description: Rule ID 403 | type: string 404 | required: true 405 | get: 406 | tags: [rules] 407 | summary: Get a rule 408 | description: Gets a rule by ID. 409 | operationId: GetRule 410 | x-ni-operation: readRules 411 | responses: 412 | 200: 413 | description: OK 414 | schema: 415 | $ref: '#/definitions/Rule' 416 | 401: 417 | $ref: '#/responses/Unauthorized' 418 | default: 419 | $ref: '#/responses/Error' 420 | delete: 421 | tags: [rules] 422 | summary: Delete a rule 423 | description: Deletes a rule by ID. 424 | operationId: DeleteRule 425 | x-ni-operation: deleteRules 426 | responses: 427 | 204: 428 | description: No Content 429 | 401: 430 | $ref: '#/responses/Unauthorized' 431 | default: 432 | $ref: '#/responses/Error' 433 | patch: 434 | tags: [rules] 435 | summary: Modify a rule 436 | description: Modifies a rule. All fields specified will have their values replaced with the given values. 437 | operationId: ModifyRule 438 | x-ni-operation: writeRules 439 | consumes: 440 | - application/merge-patch+json 441 | parameters: 442 | - in: body 443 | name: Request body 444 | required: true 445 | schema: 446 | $ref: '#/definitions/RuleCommonFields' 447 | responses: 448 | 204: 449 | description: No Content 450 | 401: 451 | $ref: '#/responses/Unauthorized' 452 | default: 453 | $ref: '#/responses/Error' 454 | /v1/delete-rules: 455 | post: 456 | tags: [rules] 457 | summary: Delete rules 458 | description: Deletes multiple rules. 459 | operationId: DeleteRules 460 | x-ni-operation: deleteRules 461 | parameters: 462 | - in: body 463 | name: Request body 464 | required: true 465 | schema: 466 | title: DeleteRequestBody 467 | type: object 468 | required: 469 | - ids 470 | properties: 471 | ids: 472 | description: The IDs of the rules which should be deleted. 473 | type: array 474 | items: 475 | type: string 476 | example: [5c40ec55e0d6441168b4c543, 5c40ec55e0d6441168b4c543] 477 | responses: 478 | 200: 479 | description: Partial Success - Indicates the request to delete was processed successfully, 480 | but one or more rules failed to delete. The included *error* object will contain 481 | an entry in the *innerErrors* array for each failed rule. 482 | schema: 483 | type: object 484 | title: DeleteRulesPartialSuccess 485 | properties: 486 | deleted: 487 | description: The *ruleId*s of the rules that were successfully deleted. 488 | type: array 489 | items: 490 | type: string 491 | example: 492 | - 5c33c212e0d6444320d9a9f4 493 | failed: 494 | description: The *ruleId*s of the rules that were not deleted. 495 | See *error* for why each rule failed to delete. Reasons include the 496 | rule could not be found or the caller is not authorized to delete the rule. 497 | type: array 498 | items: 499 | type: string 500 | example: 501 | - 5c2cf7e0e0d64403b486fcb4 502 | error: 503 | $ref: '#/definitions/Error' 504 | 204: 505 | description: Success - Indicated all requested rules were deleted successfully. 506 | 401: 507 | $ref: '#/responses/Unauthorized' 508 | default: 509 | $ref: '#/responses/Error' 510 | /v1/toggle-rules: 511 | post: 512 | tags: [rules] 513 | summary: Toggle rules 514 | description: Enables or disables multiple rules. 515 | operationId: ToggleRules 516 | x-ni-operation: writeRules 517 | parameters: 518 | - in: body 519 | name: Request body 520 | required: true 521 | schema: 522 | title: ToggleRequestBody 523 | type: object 524 | required: 525 | - ids 526 | - disabled 527 | properties: 528 | ids: 529 | description: The IDs of the rules which should be toggled. 530 | type: array 531 | items: 532 | type: string 533 | example: [5c40ec55e0d6441168b4c543, 5c40ec55e0d6441168b4c543] 534 | disabled: 535 | description: A value indicating whether or not a rule is disabled. 536 | type: boolean 537 | example: false 538 | default: false 539 | responses: 540 | 200: 541 | description: OK 542 | schema: 543 | title: ToggleResponse 544 | type: object 545 | properties: 546 | toggled: 547 | description: The IDs of the rules which were toggled. 548 | type: array 549 | items: 550 | type: string 551 | example: [5c40ec55e0d6441168b4c543, 5c40ec55e0d6441168b4c544] 552 | notFoundIds: 553 | description: The IDs of the rules which were not found. 554 | type: array 555 | items: 556 | type: string 557 | example: [5c40ec55e0d6441168b4c541] 558 | error: 559 | $ref: '#/definitions/Error' 560 | 401: 561 | $ref: '#/responses/Unauthorized' 562 | default: 563 | $ref: '#/responses/Error' 564 | /v1/query-rules: 565 | post: 566 | tags: [rules] 567 | summary: Query rules 568 | description: Queries for rules. 569 | operationId: QueryRules 570 | x-ni-operation: readRules 571 | parameters: 572 | - in: body 573 | name: Request body 574 | required: true 575 | schema: 576 | title: QueryRequestBody 577 | type: object 578 | properties: 579 | displayName: 580 | description: Display name query. Returns rules whose *displayName* fields contain the query 581 | string, without taking case into account. 582 | type: string 583 | example: low disk space 584 | description: 585 | description: Description query. Returns rules whose *description* fields contain the query 586 | string, without taking case into account. 587 | type: string 588 | example: turbine 5 589 | tagPath: 590 | description: Tag path query. If the query string contains wildcard characters, the service 591 | will return rules whose *searchPaths* either intersect with, or are matched by, the query 592 | string. For example, if the query string is CRIO1.System.Health.*, then the service would 593 | return rules with search paths of CRIO1.System.Health.Foo and 594 | *.System.Health.DiskUsePercentage. The former is matched by the query string, and the latter 595 | intersects with the query string, as there exists a string which could be matched by both 596 | expressions (such as CRIO1.System.Health.DiskUsePercentage). If the query string does not 597 | contain wildcard characters, the service will return rules whose *searchPaths* match the 598 | query string. 599 | type: string 600 | example: System1.System.Health.DiskUsePercentage 601 | properties: 602 | type: object 603 | description: Property query. The service will return rules whose *properties* fields 604 | contain all of the specified key/value pairs. 605 | additionalProperties: 606 | type: string 607 | example: 608 | key1: value1 609 | keywords: 610 | type: array 611 | description: Keyword query. The service will return rules whose *keywords* fields contain 612 | all of the specified keywords. 613 | items: 614 | type: string 615 | example: 616 | - keyword1 617 | - keyword2 618 | workspaces: 619 | type: array 620 | description: Workspace query. The service will return rules whose *workspace* field is one of 621 | the specified workspaces. Added in version 2 of the readRules operation. 622 | items: 623 | type: string 624 | example: 625 | - '*' 626 | skip: 627 | description: Number of entries to skip in the response list. Typically used in combination 628 | with the take parameter to implement pagination. 629 | type: integer 630 | default: 0 631 | take: 632 | description: Number of entries to include in the response list. Typically used in combination 633 | with the skip parameter to implement pagination. 634 | type: integer 635 | default: 10000 636 | maximum: 10000 637 | responses: 638 | 200: 639 | description: OK 640 | schema: 641 | title: QueryResponse 642 | type: object 643 | properties: 644 | rules: 645 | description: The rules matched by the filter criteria in the request body. 646 | type: array 647 | items: 648 | $ref: '#/definitions/Rule' 649 | totalCount: 650 | description: The total number of rules which matched the filter criteria. 651 | type: integer 652 | example: 1 653 | 401: 654 | $ref: '#/responses/Unauthorized' 655 | default: 656 | $ref: '#/responses/Error' 657 | /v1/duplicate-rules: 658 | post: 659 | tags: [rules] 660 | summary: Duplicate rules 661 | description: Duplicates multiple rules into a given workspace 662 | operationId: DuplicateRules 663 | x-ni-operation: writeRules 664 | parameters: 665 | - in: body 666 | name: Request body 667 | required: true 668 | schema: 669 | title: DuplicateRequestBody 670 | type: object 671 | required: 672 | - ids 673 | - workspace 674 | properties: 675 | ids: 676 | description: The IDs of the rules which should be duplicated. 677 | type: array 678 | items: 679 | type: string 680 | example: [5c40ec55e0d6441168b4c543, 5c40ec55e0d6441168b4c543] 681 | workspace: 682 | description: The ID of the workspace in which to duplicate the specified rules. 683 | type: string 684 | example: 3d411024-9db8-42d1-8ab8-6cee0e6cd841 685 | responses: 686 | 200: 687 | description: OK 688 | schema: 689 | title: DuplicateResponse 690 | type: object 691 | properties: 692 | duplicatedIds: 693 | description: A dictionary where the keys are the IDs of the rules which were successfully 694 | duplicated, and the values are the IDs of the new duplicate rules. 695 | type: object 696 | additionalProperties: 697 | type: string 698 | example: 699 | 5c40ec55e0d6441168b4c543: 5c40ec55e0d6441168b4c545 700 | 5c40ec55e0d6441168b4c544: 5c40ec55e0d6441168b4c546 701 | failed: 702 | description: The IDs of the rules which were failed to be duplicated. 703 | See *error* for why each rule failed to duplicate. Reasons include the 704 | rule could not be found or the caller is not authorized to create the rule. 705 | type: array 706 | items: 707 | type: string 708 | example: [5c40ec55e0d6441168b4c541] 709 | error: 710 | $ref: '#/definitions/Error' 711 | 401: 712 | $ref: '#/responses/Unauthorized' 713 | default: 714 | $ref: '#/responses/Error' -------------------------------------------------------------------------------- /user/niuser.yaml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1.0' 4 | title: SystemLink User Service 5 | description: 'Manage users, workspaces, and permissions for a SystemLink server.' 6 | contact: 7 | name: NI 8 | url: https://www.ni.com/systemlink 9 | email: support@ni.com 10 | basePath: /niuser/v1 11 | consumes: 12 | - application/json 13 | produces: 14 | - application/json 15 | securityDefinitions: 16 | ApiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | BasicAuth: 21 | type: basic 22 | security: 23 | - ApiKeyAuth: [] 24 | - BasicAuth: [] 25 | paths: 26 | '/users/query': 27 | post: 28 | tags: 29 | - users 30 | summary: Query the users 31 | description: >- 32 | Use the Dynamic Linq query language to specify filters for users. 33 | An empty request body queries all users. 34 | operationId: query-users 35 | parameters: 36 | - $ref: '#/parameters/QueryUsersRequest' 37 | responses: 38 | 200: 39 | $ref: '#/responses/QueryUsersResponse' 40 | 400: 41 | $ref: '#/responses/ValidationError' 42 | 401: 43 | $ref: '#/responses/Unauthorized' 44 | default: 45 | $ref: '#/responses/Error' 46 | 47 | '/users': 48 | post: 49 | tags: 50 | - users 51 | summary: Creates a new user 52 | description: Create a user 53 | operationId: create-user 54 | parameters: 55 | - $ref: '#/parameters/CreateUserRequest' 56 | responses: 57 | 200: 58 | $ref: '#/responses/CreateUserResponse' 59 | 400: 60 | $ref: '#/responses/ValidationError' 61 | 401: 62 | $ref: '#/responses/Unauthorized' 63 | default: 64 | $ref: '#/responses/Error' 65 | 66 | '/users/{id}': 67 | get: 68 | tags: 69 | - users 70 | summary: 'Get user' 71 | operationId: get-user 72 | description: Lookup a user by user id 73 | parameters: 74 | - in: path 75 | required: true 76 | name: id 77 | description: The user id 78 | type: string 79 | responses: 80 | 200: 81 | $ref: '#/responses/GetUserResponse' 82 | 401: 83 | $ref: '#/responses/Unauthorized' 84 | 404: 85 | $ref: '#/responses/NotFound' 86 | default: 87 | $ref: '#/responses/Error' 88 | put: 89 | tags: 90 | - users 91 | summary: 'Update user' 92 | operationId: update-user 93 | description: Update the user record 94 | parameters: 95 | - $ref: '#/parameters/UserId' 96 | - $ref: '#/parameters/UpdateUserRequest' 97 | responses: 98 | 200: 99 | $ref: '#/responses/UpdateUserResponse' 100 | 400: 101 | $ref: '#/responses/ValidationError' 102 | 401: 103 | $ref: '#/responses/Unauthorized' 104 | 404: 105 | $ref: '#/responses/NotFound' 106 | default: 107 | $ref: '#/responses/Error' 108 | delete: 109 | tags: 110 | - users 111 | summary: 'Delete user' 112 | description: Delete a user by user id 113 | operationId: delete-user 114 | parameters: 115 | - type: string 116 | required: true 117 | name: id 118 | in: path 119 | description: The user id 120 | responses: 121 | 204: 122 | description: Success 123 | 401: 124 | $ref: '#/responses/Unauthorized' 125 | 404: 126 | $ref: '#/responses/NotFound' 127 | default: 128 | $ref: '#/responses/Error' 129 | 130 | '/workspaces': 131 | get: 132 | tags: 133 | - workspaces 134 | summary: List workspaces 135 | description: List the workspaces of an organization 136 | operationId: get-workspaces 137 | parameters: 138 | - in: query 139 | name: name 140 | description: Filters the workspaces by name 141 | type: string 142 | - in: query 143 | name: skip 144 | description: How many workspaces to skip in the result when paging. 145 | type: integer 146 | - in: query 147 | name: take 148 | description: How many workspaces to return in the result. 149 | type: integer 150 | default: 50 151 | maximum: 100 152 | - in: query 153 | name: sortby 154 | description: The field name for sorting the results 155 | type: string 156 | enum: [name] 157 | - in: query 158 | name: order 159 | description: Sort by ascending or descending order 160 | type: string 161 | enum: [ascending, descending] 162 | responses: 163 | 200: 164 | $ref: '#/responses/GetWorkspacesResponse' 165 | 401: 166 | $ref: '#/responses/Unauthorized' 167 | post: 168 | tags: 169 | - workspaces 170 | summary: Creates a new workspace 171 | description: Create a workspace 172 | operationId: create-workspace 173 | parameters: 174 | - $ref: '#/parameters/CreateWorkspaceRequest' 175 | responses: 176 | 200: 177 | $ref: '#/responses/CreateWorkspaceResponse' 178 | 400: 179 | $ref: '#/responses/ValidationError' 180 | 401: 181 | $ref: '#/responses/Unauthorized' 182 | default: 183 | $ref: '#/responses/Error' 184 | 185 | '/workspaces/{id}': 186 | put: 187 | tags: 188 | - workspaces 189 | summary: 'Update workspace' 190 | operationId: update-workspace 191 | description: Update the workspace 192 | parameters: 193 | - $ref: '#/parameters/WorkspaceId' 194 | - $ref: '#/parameters/UpdateWorkspaceRequest' 195 | responses: 196 | 200: 197 | $ref: '#/responses/UpdateWorkspaceResponse' 198 | 400: 199 | $ref: '#/responses/ValidationError' 200 | 401: 201 | $ref: '#/responses/Unauthorized' 202 | 404: 203 | $ref: '#/responses/NotFound' 204 | default: 205 | $ref: '#/responses/Error' 206 | 207 | '/auth-mappings': 208 | get: 209 | tags: 210 | - auth-mappings 211 | summary: List auth-mappings 212 | description: List the auth-mappings of an organization 213 | operationId: get-auth-mappings 214 | parameters: 215 | - in: query 216 | name: workspace 217 | description: Filters the auth mappings by workspace 218 | type: string 219 | - in: query 220 | name: skip 221 | description: How many auth mappings to skip in the result when paging. 222 | type: integer 223 | - in: query 224 | name: take 225 | description: How many auth mappings to return in the result 226 | type: integer 227 | default: 50 228 | maximum: 100 229 | - in: query 230 | name: type 231 | description: Filters the auth mappings by type (multiple types can be specified with comma separator) 232 | type: string 233 | responses: 234 | 200: 235 | $ref: '#/responses/GetAuthMappingsResponse' 236 | 401: 237 | $ref: '#/responses/Unauthorized' 238 | default: 239 | $ref: '#/responses/Error' 240 | post: 241 | tags: 242 | - auth-mappings 243 | summary: Creates a new auth-mapping 244 | description: Create a auth-mapping 245 | operationId: create-auth-mapping 246 | parameters: 247 | - $ref: '#/parameters/CreateAuthMappingRequest' 248 | responses: 249 | 200: 250 | $ref: '#/responses/CreateAuthMappingResponse' 251 | 400: 252 | $ref: '#/responses/ValidationError' 253 | 401: 254 | $ref: '#/responses/Unauthorized' 255 | default: 256 | $ref: '#/responses/Error' 257 | 258 | '/auth-mappings/{id}': 259 | put: 260 | tags: 261 | - auth-mappings 262 | summary: 'Update auth-mapping' 263 | operationId: update-auth-mapping 264 | description: Update the auth-mapping 265 | parameters: 266 | - $ref: '#/parameters/AuthMappingId' 267 | - $ref: '#/parameters/UpdateAuthMappingRequest' 268 | responses: 269 | 200: 270 | $ref: '#/responses/UpdateAuthMappingResponse' 271 | 400: 272 | $ref: '#/responses/ValidationError' 273 | 401: 274 | $ref: '#/responses/Unauthorized' 275 | 404: 276 | $ref: '#/responses/NotFound' 277 | default: 278 | $ref: '#/responses/Error' 279 | delete: 280 | tags: 281 | - auth-mappings 282 | summary: Deletes an auth-mapping 283 | description: Deletes the auth-mapping with the given Id 284 | operationId: delete-auth-mapping 285 | parameters: 286 | - $ref: '#/parameters/AuthMappingId' 287 | responses: 288 | 204: 289 | description: Success 290 | 401: 291 | $ref: '#/responses/Unauthorized' 292 | 404: 293 | $ref: '#/responses/NotFound' 294 | default: 295 | $ref: '#/responses/Error' 296 | 297 | '/orgs/{name}': 298 | get: 299 | tags: 300 | - whitelisted operations 301 | summary: 'Get organization' 302 | operationId: get-org 303 | description: Returns the organization with the given name. The caller needs a whitelisted API key to read organizations. 304 | parameters: 305 | - in: path 306 | required: true 307 | name: name 308 | description: The org name, e.g. 'SystemLink Server' 309 | type: string 310 | responses: 311 | 200: 312 | $ref: '#/responses/GetOrgResponse' 313 | 404: 314 | $ref: '#/responses/NotFound' 315 | default: 316 | $ref: '#/responses/Error' 317 | 318 | '/websocket': 319 | get: 320 | tags: 321 | - web socket 322 | summary: Open a WebSocket session 323 | description: Opens a persistent connection to the web server that allows two-way communication using 324 | a JSON protocol. After you open a connection, you can subscribe to workspace creation notifications. 325 | Refer to the *Models* section to access the schema for these actions. 326 | operationId: OpenWebSocketSession 327 | parameters: 328 | - in: header 329 | name: Upgrade 330 | type: string 331 | required: true 332 | x-example: websocket 333 | - in: header 334 | name: Connection 335 | type: string 336 | required: true 337 | x-example: Upgrade 338 | - in: header 339 | name: Sec-WebSocket-Version 340 | description: Protocol version of the WebSocket connection. 341 | type: string 342 | required: true 343 | x-example: 13 344 | - in: header 345 | name: Sec-WebSocket-Key 346 | description: Randomly selected sixteen-byte base64-encoded string. Used to confirm a 347 | valid WebSocket handshake. Must be selected randomly for each new connection. 348 | type: string 349 | required: true 350 | x-example: dGhlIHNhbXBsZSBub25jZQ== 351 | responses: 352 | 101: 353 | description: Switching Protocols 354 | headers: 355 | Sec-WebSocket-Accept: 356 | description: Used in the WebSocket opening handshake. Set to a value derived from the 357 | Sec-WebSocket-Key header. 358 | type: string 359 | 401: 360 | $ref: '#/responses/Unauthorized' 361 | 426: 362 | description: Upgrade Required 363 | default: 364 | $ref: '#/responses/Error' 365 | 366 | parameters: 367 | UserId: 368 | in: path 369 | name: id 370 | description: The identifier of a user 371 | type: string 372 | required: true 373 | WorkspaceId: 374 | in: path 375 | name: id 376 | description: The identifier of a workspace 377 | type: string 378 | required: true 379 | AuthMappingId: 380 | in: path 381 | name: id 382 | description: The identifier of an auth mapping 383 | type: string 384 | required: true 385 | 386 | QueryUsersRequest: 387 | in: body 388 | name: queryUsersRequest 389 | description: Request to query for users 390 | schema: 391 | title: Query Users Request 392 | description: Filters to query for users 393 | type: object 394 | properties: 395 | filter: 396 | description: >- 397 | The filter criteria for users, consisting of a string of queries composed using AND/OR operators. 398 | String values need to be enclosed in double quotes. 399 | Parenthesis can be used within the filter to better define the order of operations. 400 | 401 | 402 | Filter syntax: '[property name][operator][operand] and [property name][operator][operand]' 403 | 404 | 405 | Operators: 406 | 407 | - Equals operator '='. Example: 'x = y' 408 | 409 | - Not equal operator '!='. Example: 'x != y' 410 | 411 | - Greater than operator '>'. Example: 'x > y' 412 | 413 | - Greater than or equal operator '>='. Example: 'x >= y' 414 | 415 | - Less than operator '<'. Example: 'x < y' 416 | 417 | - Less than or equal operator '<='. Example: 'x <= y' 418 | 419 | - Logical AND operator 'and'. Example: 'x and y' 420 | 421 | - Logical OR operator 'or'. Example: 'x or y' 422 | 423 | - Starts with operator '.StartsWith()', used to check whether a string starts with another string. Example: 'x.StartsWith(y)' 424 | 425 | - Does not start with operator '!.StartsWith()', used to check whether a string does not start with another string. Example: '!x.StartsWith(y)' 426 | 427 | - String null or empty 'string.IsNullOrEmpty()', used to check whether a string is null or empty. Example: 'string.IsNullOrEmpty(x)' 428 | 429 | - String is not null or empty '!string.IsNullOrEmpty()', used to check whether a string is not null or empty. Example: '!string.IsNullOrEmpty(x)' 430 | 431 | 432 | Valid user properties that can be used in the filter: 433 | 434 | - id 435 | 436 | - firstName 437 | 438 | - lastName 439 | 440 | - email 441 | 442 | - niuaId 443 | 444 | - login 445 | 446 | - status 447 | type: string 448 | example: firstName.StartsWith("John") && status == "active" 449 | take: 450 | description: The maximum number of users to return 451 | type: integer 452 | default: 50 453 | minimum: 0 454 | maximum: 100 455 | example: 10 456 | sortby: 457 | description: The field name for sorting the results 458 | type: string 459 | enum: [firstName, lastName, email, niuaId, login, status] 460 | order: 461 | description: Sort by ascending or descending order 462 | type: string 463 | enum: [ascending, descending] 464 | continuationToken: 465 | description: The continuation token can be used to paginate through the user query results. Provide this token in the next query users call. 466 | type: string 467 | example: token 468 | CreateUserRequest: 469 | in: body 470 | name: createUserRequest 471 | description: Request to create a new user 472 | schema: 473 | title: Create User Request 474 | description: Creates a new user in the callers' organization 475 | type: object 476 | properties: 477 | firstName: 478 | type: string 479 | description: First name filter 480 | lastName: 481 | type: string 482 | description: Last name filter 483 | email: 484 | type: string 485 | description: Email filter 486 | niuaId: 487 | type: string 488 | description: niua Id filter 489 | acceptedToS: 490 | type: boolean 491 | description: Filter for users which accepted or not accepted the terms of services 492 | policies: 493 | type: array 494 | items: 495 | type: string 496 | description: A list of policy ids. Defines the permissions of the user in the organization. 497 | keywords: 498 | type: array 499 | items: 500 | type: string 501 | description: A list of keywords associated with the user 502 | properties: 503 | type: object 504 | description: A map of key value properties 505 | additionalProperties: 506 | type: string 507 | example: 508 | key1: value1 509 | UpdateUserRequest: 510 | in: body 511 | name: updateUserRequest 512 | description: Request to update an existing user 513 | schema: 514 | title: Update User Request 515 | description: Updates an existing user 516 | type: object 517 | properties: 518 | firstName: 519 | type: string 520 | description: First name filter 521 | lastName: 522 | type: string 523 | description: Last name filter 524 | email: 525 | type: string 526 | description: Email filter 527 | acceptedToS: 528 | type: boolean 529 | description: Filter for users which accepted or not accepted the terms of services 530 | policies: 531 | type: array 532 | items: 533 | type: string 534 | description: A list of policy ids. Defines the permissions of the user in the organization. 535 | keywords: 536 | type: array 537 | items: 538 | type: string 539 | description: A list of keywords associated with the user 540 | properties: 541 | type: object 542 | description: A map of key value properties 543 | additionalProperties: 544 | type: string 545 | example: 546 | key1: value1 547 | 548 | CreateWorkspaceRequest: 549 | in: body 550 | name: createWorkspaceRequest 551 | description: Request to create a new workspace 552 | schema: 553 | title: Create Workspace Request 554 | description: Creates a new workspace 555 | type: object 556 | properties: 557 | name: 558 | type: string 559 | description: The workspace name, must be unique in the organization 560 | UpdateWorkspaceRequest: 561 | in: body 562 | name: updateWorkspaceRequest 563 | description: Request to update an existing workspace 564 | schema: 565 | title: Update Workspace Request 566 | description: Updates an existing workspace 567 | type: object 568 | properties: 569 | name: 570 | type: string 571 | description: The workspace name, must be unique in the organization 572 | enabled: 573 | type: boolean 574 | description: Whether the workspace is enabled or disabled. If a workspace is disabled, requests to create new resources in this workspace will fail but queries still return the resources in this workspace. 575 | 576 | CreateAuthMappingRequest: 577 | in: body 578 | name: createAuthMappingRequest 579 | description: Request to create a new auth mapping 580 | schema: 581 | title: Create Auth Mapping Request 582 | description: Creates a new auth mapping 583 | type: object 584 | properties: 585 | type: 586 | type: string 587 | enum: [user, windows-group, windows-user, ldap-group, ldap-attribute, ldap-user, oidc-claim, user-id] 588 | description: The Auth Mapping type 589 | policyId: 590 | type: string 591 | description: The policy id this mapping references. 592 | policyTemplateId: 593 | type: string 594 | description: The policy template id this mapping references. 595 | workspace: 596 | type: string 597 | description: The workspace id. 598 | selector: 599 | type: object 600 | description: The selector 601 | properties: 602 | key: 603 | type: string 604 | description: The Auth Mapping selector key 605 | value: 606 | type: string 607 | description: The Auth Mapping selector value 608 | 609 | UpdateAuthMappingRequest: 610 | in: body 611 | name: updateAuthMappingRequest 612 | description: Request to update an existing auth mapping 613 | schema: 614 | title: Update Auth Mapping Request 615 | description: Updates an existing auth mapping 616 | type: object 617 | properties: 618 | type: 619 | type: string 620 | enum: [user, windows-group, windows-user, ldap-group, ldap-attribute, ldap-user, oidc-claim, user-id] 621 | description: The Auth Mapping type 622 | policyId: 623 | type: string 624 | description: The policy id this mapping references. 625 | policyTemplateId: 626 | type: string 627 | description: The policy template id this mapping references. 628 | selector: 629 | type: object 630 | description: The selector 631 | properties: 632 | key: 633 | type: string 634 | description: The Auth Mapping selector key 635 | value: 636 | type: string 637 | description: The Auth Mapping selector value 638 | 639 | responses: 640 | Unauthorized: 641 | description: API Key is missing or invalid 642 | schema: 643 | description: Error response 644 | title: ErrorResponse 645 | type: object 646 | properties: 647 | error: 648 | $ref: '#/definitions/Error' 649 | 650 | ValidationError: 651 | description: Invalid input data 652 | schema: 653 | description: Error response 654 | title: ErrorResponse 655 | type: object 656 | properties: 657 | error: 658 | $ref: '#/definitions/Error' 659 | 660 | NotFound: 661 | description: The resource was not found. 662 | schema: 663 | description: Error response 664 | title: ErrorResponse 665 | type: object 666 | properties: 667 | error: 668 | $ref: '#/definitions/Error' 669 | 670 | Error: 671 | description: Error Response 672 | schema: 673 | description: Error response 674 | title: ErrorResponse 675 | type: object 676 | properties: 677 | error: 678 | $ref: '#/definitions/Error' 679 | 680 | GetOrgResponse: 681 | description: Auth Response 682 | schema: 683 | $ref: '#/definitions/Org' 684 | 685 | QueryUsersResponse: 686 | description: Query Users Response 687 | schema: 688 | title: Query Users Response 689 | type: object 690 | properties: 691 | continuationToken: 692 | description: The continuation token can be used to paginate through the user list results. Provide this token in the next list users call. 693 | type: string 694 | example: token 695 | users: 696 | description: List of users 697 | type: array 698 | items: 699 | $ref: '#/definitions/User' 700 | CreateUserResponse: 701 | description: Create User Response 702 | schema: 703 | $ref: '#/definitions/User' 704 | GetUserResponse: 705 | description: Get User Response 706 | schema: 707 | $ref: '#/definitions/User' 708 | UpdateUserResponse: 709 | description: Update User Response 710 | schema: 711 | $ref: '#/definitions/User' 712 | 713 | GetWorkspacesResponse: 714 | description: Get Workspaces Response 715 | schema: 716 | title: Get Workspaces Response 717 | type: object 718 | properties: 719 | workspaces: 720 | description: List of workspaces 721 | type: array 722 | items: 723 | $ref: '#/definitions/Workspace' 724 | CreateWorkspaceResponse: 725 | description: Create Workspaces Response 726 | schema: 727 | $ref: '#/definitions/Workspace' 728 | UpdateWorkspaceResponse: 729 | description: Update Workspaces Response 730 | schema: 731 | $ref: '#/definitions/Workspace' 732 | 733 | GetAuthMappingsResponse: 734 | description: Get Auth Mappings Response 735 | schema: 736 | title: Get Auth Mappings Response 737 | type: object 738 | properties: 739 | authMappings: 740 | description: List of auth mappings 741 | type: array 742 | items: 743 | $ref: '#/definitions/AuthMapping' 744 | CreateAuthMappingResponse: 745 | description: Create Auth Mapping Response 746 | schema: 747 | $ref: '#/definitions/AuthMapping' 748 | UpdateAuthMappingResponse: 749 | description: Update Auth Mapping Response 750 | schema: 751 | $ref: '#/definitions/AuthMapping' 752 | definitions: 753 | User: 754 | type: object 755 | title: User 756 | description: The user details 757 | properties: 758 | id: 759 | type: string 760 | description: The unique id 761 | firstName: 762 | type: string 763 | description: The first name 764 | lastName: 765 | type: string 766 | description: The last name 767 | email: 768 | type: string 769 | description: The email 770 | niuaId: 771 | type: string 772 | description: The external id (niuaId, SID, login name) 773 | acceptedToS: 774 | type: boolean 775 | description: Whether the user accepted the terms of service 776 | properties: 777 | type: object 778 | description: A map of key value properties associated with the user 779 | keywords: 780 | type: array 781 | items: 782 | type: string 783 | description: A list of keywords associated with the user 784 | created: 785 | type: string 786 | format: date-time 787 | description: The created timestamp 788 | example: "2019-12-02T15:31:45.379Z" 789 | updated: 790 | type: string 791 | format: date-time 792 | description: The last updated timestamp 793 | example: "2019-12-02T15:31:45.379Z" 794 | orgId: 795 | type: string 796 | description: The id of the organization 797 | policies: 798 | type: array 799 | items: 800 | type: string 801 | description: A list of policy ids 802 | status: 803 | type: string 804 | enum: [pending, active] 805 | description: The status of the users' registration 806 | Org: 807 | type: object 808 | title: Org 809 | description: Organization the user belongs to 810 | properties: 811 | id: 812 | type: string 813 | description: The unique id 814 | name: 815 | type: string 816 | description: The name of the organization 817 | owner: 818 | $ref: '#/definitions/User' 819 | workspaces: 820 | description: The list of workspaces in the organization 821 | type: array 822 | items: 823 | $ref: '#/definitions/Workspace' 824 | Workspace: 825 | type: object 826 | title: Workspace 827 | description: Information about the workspace 828 | properties: 829 | id: 830 | type: string 831 | description: The unique id 832 | name: 833 | type: string 834 | description: The workspace name 835 | enabled: 836 | type: boolean 837 | description: Whether the workspace is enabled or not 838 | default: 839 | type: boolean 840 | description: Whether the workspace is the default. The default workspace is used when callers omit a workspace id 841 | AuthMapping: 842 | type: object 843 | title: Auth Mapping 844 | description: Information about the auth mapping 845 | properties: 846 | id: 847 | type: string 848 | description: The unique id 849 | type: 850 | type: string 851 | description: The auth mapping type 852 | policyId: 853 | type: string 854 | description: The policy id this mapping references. 855 | policyTemplateId: 856 | type: string 857 | description: The policy template id this mapping references. 858 | workspace: 859 | type: string 860 | description: The workspace id. 861 | selector: 862 | type: object 863 | description: The selector 864 | properties: 865 | key: 866 | type: string 867 | description: The Auth Mapping selector key 868 | value: 869 | type: string 870 | description: The Auth Mapping selector value 871 | Error: 872 | description: Contains error information 873 | type: object 874 | properties: 875 | name: 876 | description: String error code 877 | type: string 878 | code: 879 | description: Numeric error code 880 | type: integer 881 | format: int32 882 | resourceType: 883 | description: Type of resource associated with the error 884 | type: string 885 | resourceId: 886 | description: Identifier of the resource associated with the error 887 | type: string 888 | message: 889 | description: Complete error message 890 | type: string 891 | args: 892 | description: Positional argument values for the error code 893 | type: array 894 | items: 895 | type: string 896 | innerErrors: 897 | type: array 898 | items: 899 | $ref: '#/definitions/Error' 900 | example: 901 | name: Auth.ServerError 902 | code: -12345 903 | message: There has been an error with your request 904 | args: [] 905 | innerErrors: [] 906 | 907 | WebSocketAsyncWorkspacesSubscribeRequest: 908 | title: Web Socket Workspaces Subscribe Request 909 | description: A web socket message sent by the client to subscribe to notifications when workspaces are created 910 | type: object 911 | required: 912 | - action 913 | properties: 914 | action: 915 | description: The action to perform. Must be set to "UserAsyncWorkspacesSubscribeRequest". 916 | type: string 917 | enum: ['UserAsyncWorkspacesSubscribeRequest'] 918 | example: UserAsyncWorkspacesSubscribeRequest 919 | 920 | WebSocketAsyncWorkspacesSubscribeResponse: 921 | title: Web Socket Workspaces Subscribe Response 922 | description: A web socket message sent by the server to confirm a *WebSocketAsyncWorkspacesSubscribeRequest*. 923 | type: object 924 | properties: 925 | action: 926 | description: The action performed. Must be set to "UserAsyncWorkspacesSubscribeResponse". 927 | type: string 928 | enum: ['UserAsyncWorkspacesSubscribeResponse'] 929 | example: UserAsyncWorkspacesSubscribeResponse 930 | 931 | WebSocketWorkspaceCreatedMessage: 932 | title: Web Socket Workspace Created Message 933 | description: A web socket message sent by the server when a new workspace is created. 934 | type: object 935 | properties: 936 | action: 937 | description: The action performed. Must be set to "UserWorkspacesCreatedRoutedMessage". 938 | type: string 939 | enum: ['UserWorkspacesCreatedRoutedMessage'] 940 | example: UserWorkspacesCreatedRoutedMessage 941 | workspace: 942 | $ref: '#/definitions/Workspace' 943 | -------------------------------------------------------------------------------- /user-data/niuserdata.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: User Data Service 5 | description: Manage user specific data. 6 | contact: 7 | name: NI 8 | url: https://www.ni.com/systemlink 9 | email: support@ni.com 10 | basePath: /niuserdata 11 | x-ni-routing-key: Skyline.UserData 12 | consumes: [application/json] 13 | produces: [application/json] 14 | 15 | securityDefinitions: 16 | apiKeyAuth: 17 | type: apiKey 18 | name: x-ni-api-key 19 | in: header 20 | basicAuth: 21 | type: basic 22 | cookieAuth: 23 | type: apiKey 24 | in: header 25 | name: Cookie 26 | 27 | security: 28 | - apiKeyAuth: [] 29 | - basicAuth: [] 30 | - cookieAuth: [] 31 | 32 | definitions: 33 | Error: 34 | title: Error 35 | description: Contains error information. 36 | type: object 37 | properties: 38 | name: 39 | description: String error code 40 | type: string 41 | example: Skyline.OneOrMoreErrorsOccurred 42 | code: 43 | description: Numeric error code 44 | type: integer 45 | format: int32 46 | example: -251040 47 | resourceType: 48 | description: Type of resource associated with the error 49 | type: string 50 | example: UserDataItem 51 | resourceId: 52 | description: Identifier of the resource associated with the error 53 | type: string 54 | example: '5c4b2c0756c8b455a8f849c4' 55 | message: 56 | description: Complete error message 57 | type: string 58 | example: One or more errors occurred. See the contained list for details of each error 59 | args: 60 | description: Positional argument values for the error code 61 | type: array 62 | items: 63 | type: string 64 | example: '5c4b2c0756c8b455a8f849c4' 65 | innerErrors: 66 | type: array 67 | example: 68 | - name: Skyline.InsufficientPrivileges 69 | code: -251009 70 | resourceType: string 71 | resourceId: '5c4b2c0756c8b455a8f849c4' 72 | message: Insufficient privileges. 73 | args: [] 74 | items: 75 | $ref: '#/definitions/Error' 76 | example: 77 | name: Skyline.OneOrMoreErrorsOccurred 78 | code: -251040 79 | message: One or more errors occurred. See the contained list for details of each error. 80 | args: [] 81 | innerErrors: 82 | - name: Skyline.InsufficientPrivileges 83 | code: -251009 84 | resourceType: string 85 | resourceId: '5c4b2c0756c8b455a8f849c4' 86 | message: Insufficient privileges. 87 | args: [] 88 | Operation: 89 | title: Operation 90 | description: An operation provided by the API 91 | type: object 92 | required: 93 | - available 94 | properties: 95 | available: 96 | description: Whether the operation is available to the caller 97 | type: boolean 98 | example: true 99 | version: 100 | description: Version of the available operation 101 | type: integer 102 | format: int32 103 | default: 1 104 | example: 1 105 | example: 106 | available: true 107 | version: 1 108 | V1Operations: 109 | title: Version 1 Operations 110 | description: V1 operations 111 | type: object 112 | properties: 113 | operations: 114 | description: >- 115 | Available operations in the v1 version of the API: 116 | 117 | - queryUserDataItems: Query a set of user data items 118 | 119 | - createOrUpdateUserDataItems: Create or update a set of user data items 120 | 121 | - deleteUserDataItems: Delete a set of user data items 122 | type: object 123 | properties: 124 | queryUserDataItems: 125 | $ref: '#/definitions/Operation' 126 | createOrUpdateUserDataItems: 127 | $ref: '#/definitions/Operation' 128 | deleteUserDataItems: 129 | $ref: '#/definitions/Operation' 130 | QueryOperation: 131 | title: Query Operation 132 | description: >- 133 | Query operation enum. Note that 'LESS_THAN', 'GREATER_THAN', 'LESS_THAN_OR_EQUAL', and 134 | 'GREATER_THAN_OR_EQUAL' are only supported when the data type of the comparison is a string, 135 | ISO date time, or numeric value. These are not supported on booleans, arrays, or objects 136 | (also known as dictionaries). 137 | type: string 138 | enum: 139 | - EQUAL 140 | - NOT_EQUAL 141 | - LESS_THAN 142 | - GREATER_THAN 143 | - LESS_THAN_OR_EQUAL 144 | - GREATER_THAN_OR_EQUAL 145 | IntegerQueryObject: 146 | title: Integer Query 147 | description: Integer query object 148 | type: object 149 | required: 150 | - operation 151 | - comparisonValue 152 | properties: 153 | operation: 154 | $ref: '#/definitions/QueryOperation' 155 | comparisonValue: 156 | description: Integer value to compare 157 | type: integer 158 | format: int64 159 | example: 360 160 | JsonQueryObject: 161 | title: JSON Query 162 | description: >- 163 | JSON query object. This is used when querying a field that can be any valid JSON type. 164 | type: object 165 | required: 166 | - operation 167 | - comparisonValue 168 | properties: 169 | operation: 170 | $ref: '#/definitions/QueryOperation' 171 | comparisonValue: 172 | description: >- 173 | Value to compare. This can be any valid JSON type. The type of this must match the type 174 | of the data being compared to. 175 | type: object 176 | example: 'john.smith@company.com' 177 | TimeQueryObject: 178 | title: Time Query 179 | description: Time query object 180 | type: object 181 | required: 182 | - operation 183 | - comparisonValue 184 | properties: 185 | operation: 186 | $ref: '#/definitions/QueryOperation' 187 | comparisonValue: 188 | description: ISO-8601 formatted timestamp value to compare. 189 | type: string 190 | format: date-time 191 | example: '2017-11-14T15:41:06.106Z' 192 | UserDataItemField: 193 | title: User Data Item Field 194 | description: User data item field enum 195 | type: string 196 | enum: 197 | - ID 198 | - USER 199 | - APPLICATION 200 | - CATEGORY 201 | - NAME 202 | - VALUE 203 | - VISIBLE_TO_OTHERS 204 | - REVISION 205 | - CREATED_AT 206 | - UPDATED_AT 207 | UserDataItemSortField: 208 | title: User Data Item Sort Field 209 | description: User data item sort field enum 210 | type: string 211 | enum: 212 | - ID 213 | - USER 214 | - APPLICATION 215 | - CATEGORY 216 | - NAME 217 | - VISIBLE_TO_OTHERS 218 | - REVISION 219 | - CREATED_AT 220 | - UPDATED_AT 221 | UserDataItemSortDefinitionObject: 222 | title: User Data Item Sort Definition 223 | description: Defines the field and direction for sorting user data items. 224 | type: object 225 | required: 226 | - field 227 | properties: 228 | field: 229 | $ref: '#/definitions/UserDataItemSortField' 230 | orderByDescending: 231 | description: >- 232 | Whether to sort descending instead of ascending. 233 | The elements in the list are sorted ascending by default. If the 234 | orderByDescending parameter is specified, the elements in the list 235 | are sorted based on its value. The orderByDescending value must be 236 | a boolean string. The elements in the list are sorted ascending if 237 | false and descending if true. 238 | type: boolean 239 | default: false 240 | UserDataItemQueryObject: 241 | title: User Data Item Query 242 | type: object 243 | properties: 244 | ids: 245 | description: Array of user data item IDs 246 | type: array 247 | items: 248 | type: string 249 | example: 250 | - '5c4b2c0756c8b455a8f849c4' 251 | - '5c4ed77d56c8b455a80f86b5' 252 | - '5c4ed78f56c8b455a80f870a' 253 | applications: 254 | description: Array of application names 255 | type: array 256 | items: 257 | type: string 258 | example: 259 | - 'ni-swif' 260 | - 'ni-test-management' 261 | categories: 262 | description: Array of category names 263 | type: array 264 | items: 265 | type: string 266 | example: 267 | - 'reports' 268 | - 'states' 269 | names: 270 | description: Array of user data item names 271 | type: array 272 | items: 273 | type: string 274 | example: 275 | - 'email' 276 | - 'language' 277 | valueQuery: 278 | description: >- 279 | Array of JSON query objects to query against the values of the user data items. 280 | type: array 281 | items: 282 | $ref: '#/definitions/JsonQueryObject' 283 | visibleToOthers: 284 | description: >- 285 | Match against the 'visibleToOthers' field in the user item data. If not set, will match 286 | both true and false values. 287 | type: boolean 288 | example: true 289 | revisionQuery: 290 | description: >- 291 | Array of integer query objects used to query the revision of the user data items. 292 | type: array 293 | items: 294 | $ref: '#/definitions/IntegerQueryObject' 295 | createdAtQuery: 296 | description: >- 297 | Array of time query objects used to query when the user data items were created. 298 | type: array 299 | items: 300 | $ref: '#/definitions/TimeQueryObject' 301 | updatedAtQuery: 302 | description: >- 303 | Array of time query objects used to query when the user data items were last updated. 304 | type: array 305 | items: 306 | $ref: '#/definitions/TimeQueryObject' 307 | sortBy: 308 | description: >- 309 | Array of user data item sort definition objects to define how to sort the results. 310 | type: array 311 | items: 312 | $ref: '#/definitions/UserDataItemSortDefinitionObject' 313 | projection: 314 | description: >- 315 | Array of user data item fields. If you specify an array, the query returns a result with 316 | the user data items containing the fields that are both specified and available. If you 317 | do not specify an array, the query will return a result with the user data items 318 | containing all available fields. 319 | type: array 320 | items: 321 | $ref: '#/definitions/UserDataItemField' 322 | UserDataItem: 323 | title: User Data Item 324 | description: >- 325 | Information about a specific user data item. A specific user data item may be uniquely 326 | identified by a combination of its 'user', 'application', 'category', and 'name' fields. 327 | A specific user data item is also uniquely identified by its assigned ID. 328 | type: object 329 | properties: 330 | id: 331 | description: The ID for this user data item. 332 | type: string 333 | example: '5c4b2c0756c8b455a8f849c4' 334 | user: 335 | description: >- 336 | The user that this data item belongs to. 337 | type: string 338 | example: jsmith 339 | application: 340 | description: >- 341 | The application name that this user data item belongs to. 342 | type: string 343 | example: 'ni-test-management' 344 | category: 345 | description: >- 346 | The category name in the application that this user data item belongs to. An empty category 347 | name is accepted. 348 | type: string 349 | example: 'reports' 350 | default: '' 351 | name: 352 | description: The name of the user data item. 353 | type: string 354 | example: 'email' 355 | value: 356 | description: The value of the user data item. 357 | type: object 358 | example: 'john.smith@company.com' 359 | visibleToOthers: 360 | description: >- 361 | Whether this user data item is visible to other users. This will allow other users to 362 | query this data. 363 | type: boolean 364 | example: false 365 | revision: 366 | description: >- 367 | The revision number for this user data item. When a user data item is created, the 368 | revision number starts at 1. Every time it is updated, the revision number is 369 | incremented by 1. 370 | type: integer 371 | format: int64 372 | example: 1 373 | createdAt: 374 | description: ISO-8601 formatted timestamp specifying when the user data item was created. 375 | type: string 376 | format: date-time 377 | example: '2017-11-14T15:41:06.106Z' 378 | updatedAt: 379 | description: >- 380 | ISO-8601 formatted timestamp specifying when the user data item was last updated. 381 | type: string 382 | format: date-time 383 | example: '2017-11-14T15:41:06.106Z' 384 | CreateOrUpdateUserDataItem: 385 | title: Create or Update User Data Item 386 | description: >- 387 | Create or update a specific user data item. User data items are unique to the currently 388 | logged in user. The combination of the 'application', 'category', and 'name' fields identify 389 | the specific item to create or update. 390 | type: object 391 | required: 392 | - application 393 | - name 394 | - value 395 | properties: 396 | application: 397 | description: >- 398 | The application name that this user data item belongs to. 399 | type: string 400 | example: 'ni-test-management' 401 | category: 402 | description: >- 403 | The category name in the application that this user data item belongs to. An empty category 404 | name is accepted. 405 | type: string 406 | example: 'reports' 407 | default: '' 408 | name: 409 | description: The name of the user data item. 410 | type: string 411 | example: 'email' 412 | value: 413 | description: The value of the user data item. 414 | type: object 415 | example: 'john.smith@company.com' 416 | visibleToOthers: 417 | description: >- 418 | Whether this user data item is visible to other users. This will allow other users to 419 | query this data. 420 | type: boolean 421 | example: false 422 | expectedRevision: 423 | description: >- 424 | This is an optional value. When specified, this is an integer that should be set to 425 | match the last known revision number of the user data item. If it doesn't match at the 426 | time of execution, the update request will be rejected. This is used to ensure that 427 | changes to this user data item are correctly using the previous state. This may be 428 | important, for instance, in the case where multiple clients are updating an array value 429 | at the same time. A value of 0 means that the item must not already exist. 430 | type: integer 431 | format: int64 432 | minimum: 0 433 | example: 5 434 | UpdateUserDataItem: 435 | title: Update User Data Item 436 | description: >- 437 | Update a specific user data item. 438 | type: object 439 | required: 440 | - id 441 | - value 442 | properties: 443 | id: 444 | description: The ID for this user data item. 445 | type: string 446 | example: '5c4b2c0756c8b455a8f849c4' 447 | value: 448 | description: The value of the user data item. 449 | type: object 450 | example: 'john.smith@company.com' 451 | visibleToOthers: 452 | description: >- 453 | Whether this user data item is visible to other users. This will allow other users to 454 | query this data. 455 | type: boolean 456 | example: false 457 | expectedRevision: 458 | description: >- 459 | This is an optional value. When specified, this is an integer that should be set to 460 | match the last known revision number of the user data item. If it doesn't match at the 461 | time of execution, the update request will be rejected. This is used to ensure that 462 | changes to this user data item are correctly using the previous state. This may be 463 | important, for instance, in the case where multiple clients are updating an array value 464 | at the same time. 465 | type: integer 466 | format: int64 467 | minimum: 1 468 | example: 5 469 | CreateOrUpdateUserDataItemsPartialSuccessResponse: 470 | title: Create or Update User Data Items Partial Success Response 471 | description: Create or update user data items partial success response 472 | type: object 473 | required: 474 | - succeeded 475 | - failed 476 | - error 477 | properties: 478 | succeeded: 479 | description: Array of user data items that were created or updated. 480 | type: array 481 | items: 482 | $ref: '#/definitions/UserDataItem' 483 | failed: 484 | description: Array of user data item create or update requests that failed. 485 | type: array 486 | items: 487 | $ref: '#/definitions/CreateOrUpdateUserDataItem' 488 | error: 489 | $ref: '#/definitions/Error' 490 | UpdateUserDataItemsPartialSuccessResponse: 491 | title: Update User Data Items Partial Success Response 492 | description: Update user data items partial success response 493 | type: object 494 | required: 495 | - succeeded 496 | - failed 497 | - error 498 | properties: 499 | succeeded: 500 | description: Array of user data item IDs that were updated. 501 | type: array 502 | items: 503 | type: string 504 | example: 505 | - '5c4b2c0756c8b455a8f849c4' 506 | - '5c4ed77d56c8b455a80f86b5' 507 | - '5c4ed78f56c8b455a80f870a' 508 | failed: 509 | description: Array of user data item update requests that failed. 510 | type: array 511 | items: 512 | $ref: '#/definitions/UpdateUserDataItem' 513 | error: 514 | $ref: '#/definitions/Error' 515 | DeleteUserDataItemsPartialSuccessResponse: 516 | title: Delete User Data Items Partial Success Response 517 | description: Delete user data items partial success response 518 | type: object 519 | required: 520 | - succeeded 521 | - failed 522 | - error 523 | properties: 524 | succeeded: 525 | description: Array of user data item IDs that were successfully deleted 526 | type: array 527 | items: 528 | type: string 529 | example: 530 | - '5c4b2c0756c8b455a8f849c4' 531 | - '5c4ed77d56c8b455a80f86b5' 532 | - '5c4ed78f56c8b455a80f870a' 533 | failed: 534 | description: Array of user data item IDs that failed to delete 535 | type: array 536 | items: 537 | type: string 538 | example: 539 | - '5c4ed7a256c8b455a80f87a5' 540 | - '5c4ed7b356c8b455a80f887f' 541 | error: 542 | $ref: '#/definitions/Error' 543 | 544 | parameters: 545 | userDataItemId: 546 | in: path 547 | name: id 548 | description: The ID of a specific user data item. 549 | type: string 550 | required: true 551 | x-example: '5c4b2c0756c8b455a8f849c4' 552 | 553 | responses: 554 | Error: 555 | description: Error definition object 556 | schema: 557 | description: Error response 558 | title: ErrorResponse 559 | type: object 560 | properties: 561 | error: 562 | $ref: '#/definitions/Error' 563 | Unauthorized: 564 | description: Not authorized 565 | headers: 566 | WWW_Authenticate: 567 | description: Information for how to authenticate 568 | type: string 569 | 570 | paths: 571 | /: 572 | get: 573 | operationId: RootEndpoint 574 | summary: API information 575 | description: Returns information about API versions and available operations. 576 | tags: [versioning] 577 | security: [] 578 | responses: 579 | 200: 580 | description: OK 581 | schema: 582 | description: Version information 583 | title: RootEndpointResponse 584 | type: object 585 | properties: 586 | v1: 587 | $ref: '#/definitions/V1Operations' 588 | version: 589 | description: Implementation version of the web service 590 | type: string 591 | /{version}: 592 | parameters: 593 | - in: path 594 | name: version 595 | description: Version of the API to retrieve operations 596 | type: string 597 | required: true 598 | get: 599 | operationId: RootEndpointWithVersion 600 | summary: API version information 601 | description: Returns available operations for a single version of the API 602 | tags: [versioning] 603 | security: [] 604 | responses: 605 | 200: 606 | description: OK 607 | schema: 608 | $ref: '#/definitions/V1Operations' 609 | 404: 610 | description: Not Found 611 | schema: 612 | $ref: '#/definitions/Error' 613 | /v1/items: 614 | get: 615 | operationId: GetUserDataItems 616 | x-ni-operation: queryUserDataItems 617 | x-ni-auth: true 618 | x-ni-request-variables: [REMOTE_USER] 619 | summary: Get All User Data Items 620 | description: >- 621 | Get all the visible the user data items. Which items are visible are according to the 622 | access level of the logged in user. 623 | 624 | Use the skip and take parameters to return paged responses. 625 | 626 | The orderBy and orderByDescending fields can be used to manage sorting 627 | the list by specific fields. 628 | tags: [user-data] 629 | parameters: 630 | - in: query 631 | name: skip 632 | description: >- 633 | How many user data items to skip in the result when paging. 634 | For example, a list of 100 user data items with a skip value of 50 and a take 635 | value of 25 will return entries 51 through 75. 636 | type: integer 637 | format: int32 638 | default: 0 639 | minimum: 0 640 | - in: query 641 | name: take 642 | description: >- 643 | How many user data items to return in the result. 644 | For example, a list of 100 user data items with a skip value of 50 and a take 645 | value of 25 will return entries 51 through 75. 646 | type: integer 647 | format: int32 648 | minimum: 0 649 | - in: query 650 | name: sortBy 651 | description: The name of the field to sort by. 652 | type: string 653 | enum: 654 | - ID 655 | - USER 656 | - APPLICATION 657 | - CATEGORY 658 | - NAME 659 | - VISIBLE_TO_OTHERS 660 | - REVISION 661 | - CREATED_AT 662 | - UPDATED_AT 663 | - in: query 664 | name: orderByDescending 665 | description: >- 666 | Whether to sort descending instead of ascending. 667 | The elements in the list are sorted ascending by default. If the 668 | orderByDescending parameter is specified, the elements in the list 669 | are sorted based on its value. The orderByDescending value must be 670 | a boolean string. The elements in the list are sorted ascending if 671 | false and descending if true. 672 | type: boolean 673 | default: false 674 | responses: 675 | 200: 676 | description: OK 677 | schema: 678 | description: User data item information 679 | title: QueryUserDataItemsResponse 680 | type: object 681 | required: 682 | - items 683 | - totalCount 684 | properties: 685 | items: 686 | description: Array of user data items 687 | type: array 688 | items: 689 | $ref: '#/definitions/UserDataItem' 690 | totalCount: 691 | description: Number of matching user data items 692 | type: integer 693 | format: int64 694 | post: 695 | operationId: CreateOrUpdateUserDataItems 696 | x-ni-operation: createOrUpdateUserDataItems 697 | x-ni-auth: true 698 | x-ni-request-variables: [REMOTE_USER] 699 | summary: Create or update one or more user data items 700 | description: >- 701 | Creates one or more user data items. 702 | tags: [user-data] 703 | parameters: 704 | - in: body 705 | name: createOrUpdateUserDataItems 706 | description: Array of data item information for creation or update. 707 | required: true 708 | schema: 709 | description: Array of data item information for creation or update. 710 | title: CreateOrUpdateUserDataItemsRequest 711 | type: array 712 | items: 713 | $ref: '#/definitions/CreateOrUpdateUserDataItem' 714 | minItems: 1 715 | responses: 716 | 201: 717 | description: Created 718 | schema: 719 | description: Array of user data items that were created or updated. 720 | title: CreateOrUpdateUserDataItemsResponse 721 | type: array 722 | items: 723 | $ref: '#/definitions/UserDataItem' 724 | 200: 725 | description: Partial success 726 | schema: 727 | $ref: '#/definitions/CreateOrUpdateUserDataItemsPartialSuccessResponse' 728 | 401: 729 | $ref: '#/responses/Unauthorized' 730 | default: 731 | $ref: '#/responses/Error' 732 | /v1/items/{id}: 733 | parameters: 734 | - $ref: '#/parameters/userDataItemId' 735 | get: 736 | operationId: GetUserDataItem 737 | x-ni-operation: queryUserDataItems 738 | x-ni-auth: true 739 | x-ni-request-variables: [REMOTE_USER] 740 | summary: Get information about the specified user data item 741 | description: >- 742 | Get information about the specified user data item. 743 | tags: [user-data] 744 | responses: 745 | 200: 746 | description: OK 747 | schema: 748 | $ref: '#/definitions/UserDataItem' 749 | 401: 750 | $ref: '#/responses/Unauthorized' 751 | default: 752 | $ref: '#/responses/Error' 753 | delete: 754 | operationId: DeleteUserDataItem 755 | x-ni-operation: deleteUserDataItems 756 | x-ni-auth: true 757 | x-ni-request-variables: [REMOTE_USER] 758 | summary: Delete the specified user data item 759 | description: Deletes the specified user data item. 760 | tags: [user-data] 761 | responses: 762 | 204: 763 | description: No content 764 | 401: 765 | $ref: '#/responses/Unauthorized' 766 | default: 767 | $ref: '#/responses/Error' 768 | /v1/query-items: 769 | post: 770 | operationId: QueryUserDataItems 771 | x-ni-operation: queryUserDataItems 772 | x-ni-auth: true 773 | x-ni-request-variables: [REMOTE_USER] 774 | summary: Query User Data Items 775 | description: Queries the user data items. 776 | tags: [user-data] 777 | parameters: 778 | - in: body 779 | name: queryUserDataItems 780 | description: User data item query object 781 | required: true 782 | schema: 783 | $ref: '#/definitions/UserDataItemQueryObject' 784 | - in: query 785 | name: skip 786 | description: >- 787 | How many user data items to skip in the result when paging. 788 | For example, a list of 100 user data items with a skip value of 50 and a take 789 | value of 25 will return entries 51 through 75. 790 | type: integer 791 | format: int32 792 | default: 0 793 | minimum: 0 794 | - in: query 795 | name: take 796 | description: >- 797 | How many user data items to return in the result. 798 | For example, a list of 100 user data items with a skip value of 50 and a take 799 | value of 25 will return entries 51 through 75. 800 | type: integer 801 | format: int32 802 | minimum: 0 803 | responses: 804 | 200: 805 | description: OK 806 | schema: 807 | description: User data item information 808 | title: QueryUserDataItemsResponse 809 | type: object 810 | required: 811 | - items 812 | - totalCount 813 | properties: 814 | items: 815 | description: Array of user data items 816 | type: array 817 | items: 818 | $ref: '#/definitions/UserDataItem' 819 | totalCount: 820 | description: Number of matching user data items 821 | type: integer 822 | format: int64 823 | 401: 824 | $ref: '#/responses/Unauthorized' 825 | default: 826 | $ref: '#/responses/Error' 827 | /v1/update-items: 828 | post: 829 | operationId: UpdateUserDataItems 830 | x-ni-operation: createOrUpdateUserDataItems 831 | x-ni-auth: true 832 | x-ni-request-variables: [REMOTE_USER] 833 | summary: Update one or more user data items 834 | description: >- 835 | Updates one or more user data items. 836 | tags: [user-data] 837 | parameters: 838 | - in: body 839 | name: updateUserDataItems 840 | description: Array of data item information for update. 841 | required: true 842 | schema: 843 | description: Array of data item information for update. 844 | title: UpdateUserDataItemsRequest 845 | type: array 846 | items: 847 | $ref: '#/definitions/UpdateUserDataItem' 848 | minItems: 1 849 | responses: 850 | 204: 851 | description: No content 852 | 200: 853 | description: Partial success 854 | schema: 855 | $ref: '#/definitions/UpdateUserDataItemsPartialSuccessResponse' 856 | 401: 857 | $ref: '#/responses/Unauthorized' 858 | default: 859 | $ref: '#/responses/Error' 860 | /v1/delete-items: 861 | post: 862 | operationId: DeleteUserDataItems 863 | x-ni-operation: deleteUserDataItems 864 | x-ni-auth: true 865 | x-ni-request-variables: [REMOTE_USER] 866 | summary: Delete user data items 867 | description: >- 868 | Deletes multiple user data items in a single API call. 869 | tags: [user-data] 870 | parameters: 871 | - in: body 872 | name: items 873 | description: Array of user data item IDs to delete. 874 | required: true 875 | schema: 876 | description: Array of user data item IDs to delete. 877 | title: DeleteUserDataItemsRequest 878 | type: array 879 | items: 880 | description: The ID of a user data item to delete. 881 | type: string 882 | example: '5c4b2c0756c8b455a8f849c4' 883 | minItems: 1 884 | responses: 885 | 204: 886 | description: No content 887 | 200: 888 | description: Partial success 889 | schema: 890 | $ref: '#/definitions/DeleteUserDataItemsPartialSuccessResponse' 891 | 401: 892 | $ref: '#/responses/Unauthorized' 893 | default: 894 | $ref: '#/responses/Error' 895 | -------------------------------------------------------------------------------- /file/nifile.yml: -------------------------------------------------------------------------------- 1 | swagger: '2.0' 2 | info: 3 | version: '1' 4 | title: SystemLink File Service 5 | description: Upload and download files from a SystemLink server 6 | contact: 7 | name: NI 8 | url: https://www.ni.com/systemlink 9 | email: support@ni.com 10 | basePath: /nifile 11 | consumes: [application/json] 12 | produces: [application/json] 13 | 14 | securityDefinitions: 15 | apiKeyAuth: 16 | type: apiKey 17 | name: x-ni-api-key 18 | in: header 19 | basicAuth: 20 | type: basic 21 | cookieAuth: 22 | type: apiKey 23 | in: header 24 | name: Cookie 25 | 26 | security: 27 | - apiKeyAuth: [] 28 | - basicAuth: [] 29 | - cookieAuth: [] 30 | 31 | x-ni-routing-key: Skyline.FileIngestion 32 | definitions: 33 | Link: 34 | description: A hyperlink for a resource or action on a resource 35 | type: object 36 | properties: 37 | href: 38 | type: string 39 | description: URI of the link 40 | example: /nifile/v1/service-groups 41 | required: [href] 42 | Error: 43 | description: Contains error information 44 | type: object 45 | properties: 46 | name: 47 | description: String error code 48 | type: string 49 | code: 50 | description: Numeric error code 51 | type: integer 52 | format: int32 53 | resourceType: 54 | description: Type of resource associated with the error 55 | type: string 56 | resourceId: 57 | description: Identifier of the resource associated with the error 58 | type: string 59 | message: 60 | description: Complete error message 61 | type: string 62 | args: 63 | description: Positional argument values for the error code 64 | type: array 65 | items: 66 | type: string 67 | innerErrors: 68 | type: array 69 | items: 70 | $ref: '#/definitions/Error' 71 | example: 72 | name: Skyline.OneOrMoreErrorsOccurred 73 | code: -251040 74 | message: One or more errors occurred. See the contained list for details of each error. 75 | args: [] 76 | innerErrors: 77 | - name: FileIngestion.IdNotFound 78 | code: -251608 79 | resourceType: file 80 | resourceId: '4afb2ce3741fe11d88838cc9' 81 | message: File with id '4afb2ce3741fe11d88838cc9' not found. 82 | args: ['4afb2ce3741fe11d88838cc9'] 83 | FileMetadata: 84 | description: File metadata 85 | type: object 86 | properties: 87 | _links: 88 | description: >- 89 | The links to access and manipulate the file: 90 | 91 | - data: Link to download the file using a GET request 92 | 93 | - delete: Link to delete the file using a DELETE request 94 | 95 | - self: Link to the file's metadata 96 | 97 | - updateMetadata: Link to update the file's metadata using a POST request 98 | type: object 99 | required: [self] 100 | additionalProperties: 101 | $ref: '#/definitions/Link' 102 | properties: 103 | self: 104 | $ref: '#/definitions/Link' 105 | example: 106 | data: 107 | href: /nifile/v1/service-groups/Default/files/5b0739cc741fe114f08bd06c/data 108 | delete: 109 | href: /nifile/v1/service-groups/Default/files/5b0739cc741fe114f08bd06c 110 | self: 111 | href: /nifile/v1/service-groups/Default/files/5b0739cc741fe114f08bd06c 112 | updateMetadata: 113 | href: /nifile/v1/service-groups/Default/files/5b0739cc741fe114f08bd06c/update-metadata 114 | created: 115 | description: The date and time the file was created in the file service 116 | type: string 117 | format: date-time 118 | example: '2018-05-15T18:54:27.519Z' 119 | id: 120 | description: The file's ID within the service group 121 | type: string 122 | example: '5afb2ce3741fe11d88838cc9' 123 | path: 124 | description: The path to the file on the server. This field is returned only if the user has associated privileges to view file paths. 125 | type: string 126 | example: 'C:\temp\4afb2ce3741fe11d88838cc9.txt' 127 | properties: 128 | description: The file's properties 129 | type: object 130 | additionalProperties: 131 | type: string 132 | example: 133 | Name: myfile.txt 134 | MyProperty: Value 135 | metaDataRevision: 136 | description: The file's properties revision number. When a file is uploaded, the revision number starts at 1. Every time metadata is updated, the revision number is incremented by 1. New in version 3 of the listFiles operation. 137 | type: integer 138 | format: int32 139 | example: 1 140 | serviceGroup: 141 | description: The service group that owns the file 142 | type: string 143 | example: Default 144 | size: 145 | 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. 146 | type: integer 147 | format: int32 148 | example: 7277 149 | size64: 150 | description: The 64-bit file size in bytes 151 | type: integer 152 | format: int64 153 | example: 7277 154 | workspace: 155 | description: The workspace the file belongs to 156 | type: string 157 | example: MyWorkspace 158 | lastUpdatedTimestamp: 159 | description: The date and time the file was last updated in the file service 160 | type: string 161 | format: date-time 162 | example: '2018-05-15T18:54:27.519Z' 163 | ServiceGroup: 164 | type: object 165 | properties: 166 | name: 167 | type: string 168 | description: The service group's name 169 | example: Default 170 | _links: 171 | description: >- 172 | The links that apply to a service group: 173 | 174 | - deleteFiles: Link to delete multiple files from the service group using POST 175 | 176 | - files: Link to retrieve a list of files in the service group using GET 177 | 178 | - query: Link to query for available files in the service group using POST 179 | 180 | - searchFiles: Link to retrieve a filtered list of files in the service group using GET 181 | 182 | - self: Link to the current service group 183 | 184 | - upload: Link to upload files to the service group using POST 185 | type: object 186 | required: [self] 187 | additionalProperties: 188 | $ref: '#/definitions/Link' 189 | properties: 190 | self: 191 | $ref: '#/definitions/Link' 192 | example: 193 | deleteFiles: 194 | href: /nifile/v1/service-groups/Default/delete-files 195 | files: 196 | href: /nifile/v1/service-groups/Default/files 197 | query: 198 | href: /nifile/v1/service-groups/Default/query-files 199 | searchFiles: 200 | href: /nifile/v1/service-groups/Default/files 201 | self: 202 | href: /nifile/v1/service-groups/Default 203 | upload: 204 | href: /nifile/v1/service-groups/Default/upload-files 205 | DateQuery: 206 | description: A query for a date and time field 207 | type: object 208 | properties: 209 | operation: 210 | description: The query operation 211 | type: string 212 | enum: 213 | - EQUAL 214 | - GREATER_THAN 215 | - GREATER_THAN_OR_EQUAL 216 | - LESS_THAN 217 | - LESS_THAN_OR_EQUAL 218 | - NOT_EQUAL 219 | value: 220 | description: The value of the field to search for 221 | type: string 222 | format: date-time 223 | example: '2018-05-14T00:00:00.000Z' 224 | required: 225 | - operation 226 | - value 227 | example: 228 | operation: GREATER_THAN 229 | value: '2018-05-14T00:00:00.000Z' 230 | IntegerQuery: 231 | description: A query for an integer field 232 | type: object 233 | properties: 234 | operation: 235 | description: The query operation 236 | type: string 237 | enum: 238 | - EQUAL 239 | - GREATER_THAN 240 | - GREATER_THAN_OR_EQUAL 241 | - LESS_THAN 242 | - LESS_THAN_OR_EQUAL 243 | - NOT_EQUAL 244 | value: 245 | description: The value of the field to search for 246 | type: integer 247 | format: int32 248 | example: 5000 249 | required: 250 | - operation 251 | - value 252 | example: 253 | operation: LESS_THAN 254 | value: 5000 255 | PropertyQuery: 256 | description: A query for a file property 257 | type: object 258 | properties: 259 | key: 260 | description: The name of the property to search against 261 | type: string 262 | example: Name 263 | operation: 264 | description: The query operation 265 | type: string 266 | enum: 267 | - CONTAINS 268 | - EQUAL 269 | - NOT_CONTAINS 270 | - NOT_EQUAL 271 | value: 272 | description: The value of the property to search for 273 | type: string 274 | example: myfile.txt 275 | required: 276 | - key 277 | - operation 278 | - value 279 | example: 280 | key: Name 281 | operation: CONTAINS 282 | value: myfile 283 | IdsQuery: 284 | description: A query for a list of ids 285 | type: object 286 | properties: 287 | operation: 288 | description: The query operation 289 | type: string 290 | enum: 291 | - EQUAL 292 | - NOT_EQUAL 293 | ids: 294 | description: The array of ids to search for 295 | type: array 296 | items: 297 | type: string 298 | example: '4afb2ce3741fe11d88838cc9' 299 | required: 300 | - operation 301 | - ids 302 | StringQuery: 303 | description: A query for a string field 304 | type: object 305 | properties: 306 | operation: 307 | description: The query operation 308 | type: string 309 | enum: 310 | - EQUAL 311 | - NOT_EQUAL 312 | value: 313 | description: The value of the field to search for 314 | type: string 315 | example: txt 316 | required: 317 | - operation 318 | - value 319 | Operation: 320 | description: An operation provided by the API 321 | type: object 322 | properties: 323 | available: 324 | type: boolean 325 | description: Whether the operation is available to the caller 326 | version: 327 | type: integer 328 | format: int32 329 | description: The version of the available operation 330 | required: [available] 331 | example: 332 | available: true 333 | version: 1 334 | V1Operations: 335 | description: V1 operations 336 | type: object 337 | properties: 338 | operations: 339 | description: >- 340 | Available operations in the v1 version of the API: 341 | 342 | - deleteFiles: The ability to delete uploaded files 343 | 344 | - downloadData: The ability to download file data 345 | 346 | - listFiles: The ability to list available files and service groups 347 | 348 | - queryFiles: The ability to query available files and service groups 349 | 350 | - updateMetadata: The ability to update file metadata properties 351 | 352 | - uploadFiles: The ability to upload files 353 | type: object 354 | properties: 355 | deleteFiles: 356 | $ref: '#/definitions/Operation' 357 | downloadData: 358 | $ref: '#/definitions/Operation' 359 | listFiles: 360 | $ref: '#/definitions/Operation' 361 | queryFiles: 362 | $ref: '#/definitions/Operation' 363 | updateMetadata: 364 | $ref: '#/definitions/Operation' 365 | uploadFiles: 366 | $ref: '#/definitions/Operation' 367 | 368 | parameters: 369 | id: 370 | in: path 371 | name: id 372 | description: The ID of the file 373 | type: string 374 | required: true 375 | x-example: '4afb2ce3741fe11d88838cc9' 376 | 377 | responses: 378 | PartialSuccess: 379 | description: Partial Success in the case when only a part of the request body metadata information was processed successfully. 380 | schema: 381 | title: PartialSuccessResponse 382 | description: Partial success response containing error information. 383 | type: object 384 | properties: 385 | error: 386 | $ref: '#/definitions/Error' 387 | Query: 388 | description: OK 389 | schema: 390 | description: The result of a file query 391 | title: QueryResponse 392 | type: object 393 | properties: 394 | _links: 395 | description: >- 396 | The links that apply to the collection of files for a service group: 397 | 398 | - deleteFiles: Link to delete multiple files from the service group using a POST 399 | 400 | - query: Link to query for available files in the service group using a POST 401 | 402 | - search: Link to retrieve a filtered list of files in the service group using a GET 403 | 404 | - self: Link to the current service group 405 | 406 | - upload: Link to upload files to the service group using a POST 407 | type: object 408 | required: [self] 409 | additionalProperties: 410 | $ref: '#/definitions/Link' 411 | properties: 412 | self: 413 | $ref: '#/definitions/Link' 414 | example: 415 | deleteFiles: 416 | href: /nifile/v1/service-groups/Default/delete-files 417 | query: 418 | href: /nifile/v1/service-groups/Default/query-files 419 | search: 420 | href: /nifile/v1/service-groups/Default/files 421 | self: 422 | href: /nifile/v1/service-groups/Default/files 423 | upload: 424 | href: /nifile/v1/service-groups/Default/upload-files 425 | availableFiles: 426 | description: The list of files returned by the query 427 | type: array 428 | items: 429 | $ref: '#/definitions/FileMetadata' 430 | totalCount: 431 | description: The total number of files that match the query regardless of skip and take values 432 | type: integer 433 | format: int64 434 | example: 1 435 | Error: 436 | description: Error 437 | schema: 438 | description: Error response 439 | title: ErrorResponse 440 | type: object 441 | properties: 442 | error: 443 | $ref: '#/definitions/Error' 444 | Unauthorized: 445 | description: Not authorized 446 | headers: 447 | WWW_Authenticate: 448 | description: Information for how to authenticate 449 | type: string 450 | 451 | paths: 452 | /: 453 | get: 454 | tags: [versioning] 455 | summary: API information 456 | description: Returns information about API versions and available operations. 457 | operationId: RootEndpoint 458 | # Explicitly mark security as an empty array - this route does not require any privileges. 459 | # Marking it this way prevents it from inheriting the top-level security settings. 460 | security: [] 461 | responses: 462 | 200: 463 | description: OK 464 | schema: 465 | description: Version information 466 | title: RootEndpointResponse 467 | type: object 468 | properties: 469 | v1: 470 | $ref: '#/definitions/V1Operations' 471 | version: 472 | description: The implementation version of the web service 473 | type: string 474 | /{version}: 475 | parameters: 476 | - in: path 477 | name: version 478 | description: The version of the API to retrieve operations. 479 | type: string 480 | required: true 481 | get: 482 | tags: [versioning] 483 | summary: API version information 484 | description: Returns available operations for a single version of the API. 485 | operationId: RootEndpointWithVersion 486 | # Explicitly mark security as an empty array - this route does not require any privileges. 487 | # Marking it this way prevents it from inheriting the top-level security settings. 488 | security: [] 489 | responses: 490 | 200: 491 | description: OK 492 | schema: 493 | $ref: '#/definitions/V1Operations' 494 | 404: 495 | description: Not Found 496 | schema: 497 | $ref: '#/definitions/Error' 498 | /v1/service-groups: 499 | get: 500 | tags: [service groups] 501 | summary: List service groups 502 | description: >- 503 | Returns an array of File service group names. Each service group is a 504 | distinct collection of files. 505 | operationId: ListServiceGroups 506 | x-ni-auth: true 507 | x-ni-operation: listFiles 508 | responses: 509 | 200: 510 | description: OK 511 | schema: 512 | description: Service group information 513 | title: ListServiceGroupsResponse 514 | type: object 515 | properties: 516 | _links: 517 | type: object 518 | description: >- 519 | Links that apply to the collection of service groups: 520 | 521 | - self: Link to the collection of service groups 522 | properties: 523 | self: 524 | $ref: '#/definitions/Link' 525 | serviceGroups: 526 | type: array 527 | description: Array of service groups within the file service 528 | items: 529 | $ref: '#/definitions/ServiceGroup' 530 | 401: 531 | $ref: '#/responses/Unauthorized' 532 | /v1/service-groups/Default/files: 533 | get: 534 | tags: [files] 535 | summary: List available files 536 | description: >- 537 | Lists available files on the SystemLink File service. 538 | 539 | Use the skip and take parameters to return paged responses. 540 | 541 | The orderBy and orderByDescending fields can be used to manage sorting 542 | the list by metadata objects. 543 | operationId: ListAvailableFiles_GET 544 | x-ni-auth: true 545 | x-ni-operation: listFiles 546 | parameters: 547 | - in: query 548 | name: skip 549 | description: >- 550 | How many files to skip in the result when paging. 551 | For example, a list of 100 files with a skip value of 50 and a take 552 | value of 25 will return entries 51 through 75. 553 | type: integer 554 | format: int32 555 | default: 0 556 | minimum: 0 557 | - in: query 558 | name: take 559 | description: >- 560 | How many files to return in the result, or 0 to use a default 561 | defined by the service. 562 | For example, a list of 100 files with a skip value of 50 and a take 563 | value of 25 will return entries 51 through 75. 564 | type: integer 565 | format: int32 566 | default: 0 567 | minimum: 0 568 | maximum: 10000 569 | - in: query 570 | name: orderBy 571 | description: >- 572 | The name of the metadata key to sort by. The value of the orderBy field should be 573 | the name of a metadata key. 574 | type: string 575 | enum: 576 | - created 577 | - id 578 | - size 579 | - lastUpdatedTimestamp 580 | - in: query 581 | name: orderByDescending 582 | description: >- 583 | Whether to sort descending instead of ascending. 584 | The elements in the list are sorted ascending by default. If the 585 | orderByDescending parameter is specified, the elements in the list 586 | are sorted based on it's value. The orderByDescending value must be 587 | a boolean string. The elements in the list are sorted ascending if 588 | false and descending if true. 589 | type: boolean 590 | default: false 591 | - in: query 592 | name: id 593 | description: Comma-separated list of file IDs to search by 594 | type: string 595 | x-example: '5afb2ce3741fe11d88838cc9,4afb2ce3741fe11d88838cc9' 596 | responses: 597 | 200: 598 | $ref: '#/responses/Query' 599 | 401: 600 | $ref: '#/responses/Unauthorized' 601 | default: 602 | $ref: '#/responses/Error' 603 | /v1/service-groups/Default/files/{id}: 604 | parameters: 605 | - $ref: '#/parameters/id' 606 | delete: 607 | tags: [files] 608 | summary: Delete file 609 | description: Deletes the file indicated by the resource ID. 610 | operationId: Delete 611 | x-ni-auth: true 612 | x-ni-operation: deleteFiles 613 | x-ni-request-variables: [REMOTE_USER, USER_NAME] 614 | responses: 615 | 204: 616 | description: No content 617 | 401: 618 | $ref: '#/responses/Unauthorized' 619 | default: 620 | $ref: '#/responses/Error' 621 | parameters: 622 | - in: query 623 | name: force 624 | description: Whether the deletion of a file will be forced. New in version 2 of this operation. 625 | type: boolean 626 | default: false 627 | /v1/service-groups/Default/files/{id}/data: 628 | parameters: 629 | - $ref: '#/parameters/id' 630 | get: 631 | tags: [files] 632 | summary: Download file 633 | description: >- 634 | Downloads a file from the SystemLink File service in 635 | a single HTTP response. 636 | 637 | Use the inline parameter in the query string to control the download 638 | behavior. 639 | x-ni-auth: true 640 | operationId: ReceiveFile 641 | x-ni-operation: downloadData 642 | x-ni-request-variables: 643 | - REQUEST_METHOD 644 | parameters: 645 | - in: query 646 | name: inline 647 | description: >- 648 | Whether to return the file data inline rather than as an attachment. 649 | When the inline query parameter is true, the file contents return 650 | directly for the caller to handle. The Content-Disposition header 651 | and MIME type remain unset. 652 | When the the inline query parameter is not specified or is 653 | false, the file contents are handled as a download. The 654 | Content-Disposition header is set to 'attachment' and 655 | the MIME type is set to binary. 656 | type: boolean 657 | default: false 658 | produces: 659 | - application/octet-stream 660 | - application/json 661 | responses: 662 | 200: 663 | description: OK 664 | schema: 665 | description: The file data 666 | type: file 667 | examples: 668 | application/octet-stream: 669 | File data 670 | 401: 671 | $ref: '#/responses/Unauthorized' 672 | default: 673 | $ref: '#/responses/Error' 674 | /v1/service-groups/Default/files/{id}/update-metadata: 675 | parameters: 676 | - $ref: '#/parameters/id' 677 | post: 678 | tags: [files] 679 | summary: Update file metadata properties 680 | description: >- 681 | Updates an existing file's metadata with the specified metadata 682 | properties. 683 | 684 | Use the replaceExisting element to determine the replace or merge 685 | behavior. 686 | operationId: UpdateMetadata 687 | x-ni-auth: true 688 | x-ni-operation: updateMetadata 689 | x-ni-request-variables: [REMOTE_USER, USER_NAME] 690 | parameters: 691 | - in: body 692 | name: metadata 693 | description: The file's metadata and options for updating it 694 | required: true 695 | schema: 696 | description: The file's metadata and options for updating it 697 | title: UpdateMetadataRequest 698 | type: object 699 | properties: 700 | replaceExisting: 701 | description: >- 702 | Determines whether the current list should be entirely 703 | replaced by the specified list or merged with the existing 704 | list. 705 | type: boolean 706 | expectedRevision: 707 | 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 metadata. If it doesn't match at the time of execution, the update request will be rejected. This is used to ensure that changes to this file metadata are correctly using the previous state. 708 | type: integer 709 | format: int32 710 | properties: 711 | description: >- 712 | The properties to set. A map of key value properties containing the metadata to be attached. 713 | Predefined: 714 | - Name: This is an optional property for renaming the file. When specified, the file will be renamed. 715 | type: object 716 | additionalProperties: 717 | type: string 718 | example: 719 | key: value 720 | workspace: 721 | description: This is an optional value. When specified, the workspace of the metadata will be updated to the new value. 722 | type: string 723 | required: 724 | - replaceExisting 725 | - properties 726 | responses: 727 | 204: 728 | description: No content 729 | 401: 730 | $ref: '#/responses/Unauthorized' 731 | default: 732 | $ref: '#/responses/Error' 733 | /v1/service-groups/Default/delete-files: 734 | post: 735 | tags: [files] 736 | summary: Delete multiple files 737 | description: >- 738 | Deletes multiple files in a single API call. The request body contains 739 | an array of file ids to delete. 740 | operationId: DeleteMultiple 741 | x-ni-auth: true 742 | x-ni-operation: deleteFiles 743 | x-ni-request-variables: [REMOTE_USER, USER_NAME] 744 | parameters: 745 | - in: query 746 | name: force 747 | description: Whether the deletion of files will be forced. New in version 2 of this operation. 748 | type: boolean 749 | default: false 750 | - in: body 751 | name: files 752 | description: The description of files to delete 753 | required: true 754 | schema: 755 | description: The description of files to delete 756 | title: DeleteMultipleRequest 757 | type: object 758 | properties: 759 | ids: 760 | description: The list of file IDs to delete 761 | type: array 762 | items: 763 | description: The ID of a file to delete 764 | type: string 765 | example: '5afb2ce3741fe11d88838cc9' 766 | required: [ids] 767 | responses: 768 | 200: 769 | $ref: '#/responses/PartialSuccess' 770 | 204: 771 | description: No content 772 | 401: 773 | $ref: '#/responses/Unauthorized' 774 | default: 775 | $ref: '#/responses/Error' 776 | /v1/service-groups/Default/query-files: 777 | post: 778 | tags: [files] 779 | summary: Query files 780 | description: >- 781 | Queries the SystemLink File service for a list of files that match 782 | specified metadata properties. 783 | 784 | Query elements: 785 | 786 | - idQuery: a JSON query object with a string value. 787 | 788 | - sizeMaxQuery: a JSON query object with an integer value. 789 | 790 | - sizeMinQuery: a JSON query object with an integer value. 791 | 792 | - createdQuery: a JSON query object with an ISO8601 date string value. 793 | 794 | - propertiesQuery: a JSON array of query objects with string values. 795 | operationId: QueryAvailableFiles 796 | x-ni-auth: true 797 | x-ni-operation: listFiles 798 | parameters: 799 | - in: query 800 | name: skip 801 | description: How many files to skip in the result when paging. New in version 2 of the list-files operation. 802 | type: integer 803 | format: int32 804 | default: 0 805 | minimum: 0 806 | - in: query 807 | name: take 808 | description: >- 809 | How many files to return in the result. New in version 2 of the list-files operation. 810 | The default value is defined by the service. 811 | type: integer 812 | format: int32 813 | default: 1000 814 | minimum: 0 815 | maximum: 1000 816 | - in: query 817 | name: workspace 818 | description: Limit the query to the workspace with the given id. New in version 2 of this operation. 819 | type: string 820 | default: null 821 | x-example: 1f2641dd-a5ac-4869-835e-5340b4cd386c 822 | - in: body 823 | name: query 824 | description: The queries used to filter the result 825 | schema: 826 | description: The queries used to filter the results 827 | title: QueryAvailableFilesRequest 828 | type: object 829 | properties: 830 | idsQuery: 831 | $ref: '#/definitions/IdsQuery' 832 | idQuery: 833 | $ref: '#/definitions/StringQuery' 834 | extensionQuery: 835 | $ref: '#/definitions/StringQuery' 836 | sizeMaxQuery: 837 | $ref: '#/definitions/IntegerQuery' 838 | sizeMinQuery: 839 | $ref: '#/definitions/IntegerQuery' 840 | createdQuery: 841 | $ref: '#/definitions/DateQuery' 842 | propertiesQuery: 843 | description: An array of queries for file properties 844 | type: array 845 | items: 846 | $ref: '#/definitions/PropertyQuery' 847 | responses: 848 | 200: 849 | $ref: '#/responses/Query' 850 | 401: 851 | $ref: '#/responses/Unauthorized' 852 | default: 853 | $ref: '#/responses/Error' 854 | /v1/service-groups/Default/upload-files: 855 | post: 856 | tags: [files] 857 | summary: Upload file 858 | description: >- 859 | Uploads a file using multipart/form-data headers to send the file 860 | payload in the HTTP body. 861 | operationId: Upload 862 | x-ni-auth: true 863 | x-ni-operation: uploadFiles 864 | x-ni-request-variables: [REMOTE_USER, USER_NAME] 865 | consumes: 866 | - multipart/form-data 867 | parameters: 868 | - in: formData 869 | name: file 870 | description: The file to upload. 871 | type: file 872 | required: true 873 | - in: formData 874 | name: metadata 875 | description: JSON Dictionary with key/value pairs 876 | type: string 877 | - in: formData 878 | name: id 879 | description: >- 880 | Optional field that allows the client to specify the ID of the file 881 | once it is uploaded. An ID is expected to be a 24-digit hex string, 882 | which is unique among all files. 883 | type: string 884 | - in: query 885 | name: workspace 886 | description: The id of the workspace the file belongs to 887 | type: string 888 | default: null 889 | x-example: 1f2641dd-a5ac-4869-835e-5340b4cd386c 890 | responses: 891 | 201: 892 | description: OK 893 | schema: 894 | description: Uploaded file information 895 | title: UploadResponse 896 | type: object 897 | properties: 898 | uri: 899 | type: string 900 | description: URI of the uploaded file 901 | example: '/nifile/v1/service-groups/Default/files/5b874c4adedd0f1c78a22a96' 902 | 401: 903 | $ref: '#/responses/Unauthorized' 904 | default: 905 | $ref: '#/responses/Error' 906 | /v1/ping: 907 | get: 908 | tags: [deprecated] 909 | summary: Check service status 910 | description: Determines if the web service is available 911 | operationId: Ping 912 | deprecated: true 913 | # Explicitly mark security as an empty array - this route does not require any privileges. 914 | # Marking it this way prevents it from inheriting the top-level security settings. 915 | security: [] 916 | responses: 917 | 204: 918 | description: No content 919 | --------------------------------------------------------------------------------