Skip to content

Commit

Permalink
Update Jobs API with new parameter support (Azure#14238)
Browse files Browse the repository at this point in the history
* Add new 1.0.0 version for IoT Central API

* fix swagger style

* fix wrong json file name

* remove unused examples

* revert back email format

* remove non-used examples

* update with latest examples

* update preview from 2019-10-28-preview to 2021-04-30-preview

* remove extra ---

* update version from 1.0.0 to 1.0

* rollback collections for common entities

* update _id to Id, update _name to Name from operation, add sdk generation

* fix go sdk file

* remove go sdk

* updatedevicve_templateId to deviceTemplateId

* Add query parameter based versioning, remove resource schema

* fix example docs reference

* fix typo in comments

* renaming execute to run for command operations

* add api-version to samples files, fix devices_update missining issue

* add devices_update.json for 1.0

* fix rerun_id, add missing parameters to examples for preview, fix command comments from execute to run

* fix annoymous type issues

* add job parameter, update python with different version

* add more description for 1.0 device template id and fix sample @types in device template
  • Loading branch information
yang-hai-feng authored May 5, 2021
1 parent 49f426d commit 8169805
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"body": {
"displayName": "My Job",
"group": "475cad48-b7ff-4a09-b51e-1a9021385453",
"batch": {
"type": "percentage",
"value": 10
},
"cancellationThreshold": {
"type": "number",
"value": 2,
"batch": false
},
"data": [
{
"type": "PropertyJobData",
Expand All @@ -26,6 +35,15 @@
"id": "myJobId",
"displayName": "My Job",
"group": "475cad48-b7ff-4a09-b51e-1a9021385453",
"batch": {
"type": "percentage",
"value": 10
},
"cancellationThreshold": {
"type": "number",
"value": 2,
"batch": false
},
"data": [
{
"type": "PropertyJobData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,14 @@
"description": "The ID of the device group on which to execute the job.",
"type": "string"
},
"batch": {
"description": "The batching configuration for the job.",
"$ref": "#/definitions/JobBatch"
},
"cancellationThreshold": {
"description": "The cancellation threshold for the job.",
"$ref": "#/definitions/JobCancellationThreshold"
},
"data": {
"description": "The capabilities being updated by the job and the values with which they are being updated.",
"type": "array",
Expand All @@ -541,6 +549,52 @@
"data"
]
},
"JobBatch": {
"type": "object",
"properties": {
"type": {
"description": "Whether batching is done on a specified number of devices or a percentage of the total devices.",
"type": "string",
"enum": [
"number",
"percentage"
]
},
"value": {
"description": "The number or percentage of devices on which batching is done.",
"type": "number"
}
},
"required": [
"type",
"value"
]
},
"JobCancellationThreshold": {
"type": "object",
"properties": {
"type": {
"description": "Whether the cancellation threshold is per a specified number of devices or a percentage of the total devices.",
"type": "string",
"enum": [
"number",
"percentage"
]
},
"value": {
"description": "The number or percentage of devices on which the cancellation threshold is applied.",
"type": "number"
},
"batch": {
"description": "Whether the cancellation threshold applies per-batch or to the overall job.",
"type": "boolean"
}
},
"required": [
"type",
"value"
]
},
"JobCollection": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
{
"@type": [
"Property",
"CloudProperty"
"Cloud"
],
"displayName": "Test Cloud Property",
"name": "testCloudProperty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
{
"@type": [
"Property",
"CloudProperty"
"Cloud"
],
"displayName": "Test Cloud Property",
"name": "testCloudProperty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
{
"@type": [
"Property",
"CloudProperty"
"Cloud"
],
"displayName": "Test Cloud Property",
"name": "testCloudProperty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@
"DeviceTemplateId": {
"in": "path",
"name": "deviceTemplateId",
"description": "Unique ID of the device template.",
"description": "Digital Twin Model Identifier of the device template, [More Details](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#digital-twin-model-identifier)",
"x-ms-parameter-location": "method",
"type": "string",
"required": true
Expand Down
24 changes: 19 additions & 5 deletions specification/iotcentral/data-plane/readme.python.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@ python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: Microsoft.Azure.IoTCentral
no-namespace-folders: true
clear-output-folder: true
```
### Tag: package-2021-04-30-preview
These settings apply only when `--tag=package-2021-04-30-preview` is specified on the command line.

```yaml $(tag) == 'package-2021-04-30-preview'
python:
namespace: Microsoft.Azure.IotCentral.Preview
package-name: iotcentral
package-version: 2021-04-30-preview
clear-output-folder: true
output-folder: $(python-sdks-folder)/iotcentral/preview
```

```yaml $(python)
### Tag: package-1.0
These settings apply only when `--tag=package-1.0` is specified on the command line.

```yaml $(tag) == 'package-1.0'
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/iotcentral
namespace: Microsoft.Azure.IotCentral.Stable
package-name: iotcentral
package-version: 1.0
output-folder: $(python-sdks-folder)/iotcentral/1.0
```

0 comments on commit 8169805

Please sign in to comment.