Skip to content

Commit

Permalink
Updated bulkProperties endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-r-thorpe committed Mar 7, 2024
1 parent 123c133 commit 029b7ae
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 80 deletions.
78 changes: 21 additions & 57 deletions APIs/ConfigurationAPI.raml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,34 @@ documentation:
/bulkProperties:
displayName: 'Bulk Properties'
get:
description: 'Get Bulk Properties of the object'
body:
type: !include schemas/bulkProperties-get-request.json
description: 'Get Bulk Properties of the object, returned as a NcMethodResultBulkValuesHolder object.'
queryParameters:
recurse:
description: True will get Bulk Properties for this object and all child objects
description: 'True will get Bulk Properties for this object and all child objects'
type: boolean
responses:
200:
body:
type: !include schemas/bulkProperties-get-response.json
example: !include examples/bulkProperties-get-200.json
options:
description: 'Validate an NcBulkValuesHolder object against the Device Model'
body:
type: !include schemas/bulkProperties-validate-request.json
example: !include examples/bulkProperties-validate-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-validate-response.json
example: !include examples/bulkProperties-validate-200.json
put:
description: 'Set a Bulk Properties object on the Device Model'
body:
type: !include schemas/bulkProperties-set-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-set-response.json
/properties:
displayName: 'Properties'
get:
Expand Down Expand Up @@ -168,56 +185,3 @@ documentation:
description: 'Returned when the Class Descriptor of this object was unable to be retrieved. Corresponds to NcMethodStatus code 500.'
body:
type: !include schemas/ms05-error.json
/bulkProperties:
displayName: 'Bulk Properties Functions'
get:
description: 'Shows the Bulk Properties functions'
responses:
200:
body:
/validate:
displayName: 'Validate Bulk Properties'
patch:
description: 'Validate a Bulk Properties object against the Device Model'
body:
type: !include schemas/bulkProperties-validate-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-validate-response.json
/set:
displayName: 'Set Bulk Properties'
put:
description: 'Set a Bulk Properties object on the Device Model'
body:
type: !include schemas/bulkProperties-set-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-set-response.json
/bulkProperties_alternative:
displayName: 'Bulk Properties Functions'
get:
description: 'GET /rolePaths/root/bulkProperties'
body:
type: !include schemas/bulkProperties-get-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-get-response.json
patch:
description: 'Validate a Bulk Properties object against the Device Model'
body:
type: !include schemas/bulkProperties-validate-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-validate-response.json
put:
description: 'Set a Bulk Properties object on the Device Model'
body:
type: !include schemas/bulkProperties-set-request.json
responses:
200:
body:
type: !include schemas/bulkProperties-set-response.json
13 changes: 0 additions & 13 deletions APIs/schemas/bulkProperties-get-request.json

This file was deleted.

2 changes: 1 addition & 1 deletion APIs/schemas/bulkProperties-get-response.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "NcMethodResultBulkValuesHolder",
"description": "Returns a NcMethodResultBulkValuesHolder from a bulkProperties GET",
"title": "NcMethodResultBulkValuesHolder"
}
8 changes: 5 additions & 3 deletions APIs/schemas/bulkProperties-set-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"required": [
"arguments"
],
"arguments": {
"type": "object",
"description": "Method arguments. Arguments are specified as nested properties inside this object and their types are dictated by the specific MS-05-02 model for the method targeted. Arguments only need to be included for methods which have arguments and MUST be omitted if the method does not require any arguments."
"properties": {
"arguments": {
"type": "object",
"description": "Method arguments. Arguments are specified as nested properties inside this object and their types are dictated by the specific MS-05-02 model for the method targeted. Arguments only need to be included for methods which have arguments and MUST be omitted if the method does not require any arguments."
}
}
}
2 changes: 1 addition & 1 deletion APIs/schemas/bulkProperties-set-response.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "NcMethodResultObjectPropertiesSetValidation",
"description": "Returns a NcMethodResultObjectPropertiesSetValidation from a bulkProperties PUT",
"title": "NcMethodResultObjectPropertiesSetValidation"
}
10 changes: 6 additions & 4 deletions APIs/schemas/bulkProperties-validate-request.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "PATCH request body for invoking ValidateSetPropertiesByPaths method on NcBulkPropertiesManager",
"description": "PATCH request body for validating NcBulkValuesHolder object.",
"title": "ValidateSetPropertiesByPaths",
"required": [
"arguments"
],
"arguments": {
"type": "object",
"description": "Method arguments. Arguments are specified as nested properties inside this object and their types are dictated by the specific MS-05-02 model for the method targeted. Arguments only need to be included for methods which have arguments and MUST be omitted if the method does not require any arguments."
"properties": {
"arguments": {
"type": "object",
"description": "Method arguments. Arguments are specified as nested properties inside this object and their types are dictated by the specific MS-05-02 model for the method targeted. Arguments only need to be included for methods which have arguments and MUST be omitted if the method does not require any arguments."
}
}
}
2 changes: 1 addition & 1 deletion APIs/schemas/bulkProperties-validate-response.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "NcMethodResultObjectPropertiesSetValidation",
"description": "Returns a NcMethodResultObjectPropertiesSetValidation from a bulkProperties OPTIONS",
"title": "NcMethodResultObjectPropertiesSetValidation"
}
29 changes: 29 additions & 0 deletions examples/bulkProperties-get-200.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"status": 200,
"validationFingerprint": null,
"values": [
{
"rolePath": [ "root", "stereo-gain" ],
"values": [
{
"id": {
"level": 1,
"index": 6
},
"name": "userLabel",
"isReadOnly": false,
"value": "this is the property value"
},
{
"id": {
"level": 2,
"index": 1
},
"name": "enabled",
"isReadOnly": false,
"value": true
}
]
}
]
}
14 changes: 14 additions & 0 deletions examples/bulkProperties-set-200.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"value": [
{
"rolePath": [ "root", "stereo-gain" ],
"status": 200,
"statusMessage": "OK"
},
{
"rolePath": [ "root", "channel-gain" ],
"status": 200,
"statusMessage": "OK"
}
]
}
56 changes: 56 additions & 0 deletions examples/bulkProperties-set-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"arguments": {
"dataSet": {
"validationFingerprint": null,
"values": [
{
"rolePath": [ "root", "stereo-gain" ],
"values": [
{
"id": {
"level": 1,
"index": 6
},
"name": "userLabel",
"isReadOnly": false,
"value": "Stereo Gain Block"
},
{
"id": {
"level": 2,
"index": 1
},
"name": "enabled",
"isReadOnly": false,
"value": true
}
]
},
{
"rolePath": [ "root", "channel-gain" ],
"values": [
{
"id": {
"level": 1,
"index": 6
},
"name": "userLabel",
"isReadOnly": false,
"value": "Channel Gain Block"
},
{
"id": {
"level": 2,
"index": 1
},
"name": "enabled",
"isReadOnly": false,
"value": true
}
]
}
]
},
"recurse": false
}
}
14 changes: 14 additions & 0 deletions examples/bulkProperties-validate-200.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"value": [
{
"rolePath": [ "root", "stereo-gain" ],
"status": 200,
"statusMessage": "OK"
},
{
"rolePath": [ "root", "channel-gain" ],
"status": 200,
"statusMessage": "OK"
}
]
}
56 changes: 56 additions & 0 deletions examples/bulkProperties-validate-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"arguments": {
"dataSet": {
"validationFingerprint": null,
"values": [
{
"rolePath": [ "root", "stereo-gain" ],
"values": [
{
"id": {
"level": 1,
"index": 6
},
"name": "userLabel",
"isReadOnly": false,
"value": "Stereo Gain Block"
},
{
"id": {
"level": 2,
"index": 1
},
"name": "enabled",
"isReadOnly": false,
"value": true
}
]
},
{
"rolePath": [ "root", "channel-gain" ],
"values": [
{
"id": {
"level": 1,
"index": 6
},
"name": "userLabel",
"isReadOnly": false,
"value": "Channel Gain Block"
},
{
"id": {
"level": 2,
"index": 1
},
"name": "enabled",
"isReadOnly": false,
"value": true
}
]
}
]
},
"recurse": false
}
}

0 comments on commit 029b7ae

Please sign in to comment.