Skip to content

Commit 3f0176f

Browse files
authored
Merge pull request #7573 from TheThingsNetwork/feature/batch-mac-settings-profile
Set, unset MAC settings profile to batch of end devices
2 parents 2b6558e + 20b4c6d commit 3f0176f

22 files changed

Lines changed: 1846 additions & 443 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ For details about compatibility between different releases, see the **Commitment
1111

1212
### Added
1313

14+
- Support to associate/disassociate MAC settings profiles to batch of end devices
15+
- This feature is experimental and subject to change.
16+
1417
### Changed
1518

1619
### Deprecated

api/ttn/lorawan/v3/api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
- [Message `ADRSettings.StaticMode`](#ttn.lorawan.v3.ADRSettings.StaticMode)
245245
- [Message `BatchDeleteEndDevicesRequest`](#ttn.lorawan.v3.BatchDeleteEndDevicesRequest)
246246
- [Message `BatchGetEndDevicesRequest`](#ttn.lorawan.v3.BatchGetEndDevicesRequest)
247+
- [Message `BatchSetMACSettingsProfileRequest`](#ttn.lorawan.v3.BatchSetMACSettingsProfileRequest)
247248
- [Message `BatchUpdateEndDeviceLastSeenRequest`](#ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest)
248249
- [Message `BatchUpdateEndDeviceLastSeenRequest.EndDeviceLastSeenUpdate`](#ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest.EndDeviceLastSeenUpdate)
249250
- [Message `BoolValue`](#ttn.lorawan.v3.BoolValue)
@@ -3929,6 +3930,21 @@ Configuration options for static ADR.
39293930
| `application_ids` | <p>`message.required`: `true`</p> |
39303931
| `device_ids` | <p>`repeated.min_items`: `1`</p><p>`repeated.max_items`: `20`</p><p>`repeated.items.string.max_len`: `36`</p><p>`repeated.items.string.pattern`: `^[a-z0-9](?:[-]?[a-z0-9]){2,}$`</p> |
39313932

3933+
### <a name="ttn.lorawan.v3.BatchSetMACSettingsProfileRequest">Message `BatchSetMACSettingsProfileRequest`</a>
3934+
3935+
| Field | Type | Label | Description |
3936+
| ----- | ---- | ----- | ----------- |
3937+
| `application_ids` | [`ApplicationIdentifiers`](#ttn.lorawan.v3.ApplicationIdentifiers) | | |
3938+
| `mac_settings_profile_ids` | [`MACSettingsProfileIdentifiers`](#ttn.lorawan.v3.MACSettingsProfileIdentifiers) | | |
3939+
| `device_ids` | [`string`](#string) | repeated | |
3940+
3941+
#### Field Rules
3942+
3943+
| Field | Validations |
3944+
| ----- | ----------- |
3945+
| `application_ids` | <p>`message.required`: `true`</p> |
3946+
| `device_ids` | <p>`repeated.min_items`: `1`</p><p>`repeated.max_items`: `20`</p><p>`repeated.items.string.max_len`: `36`</p><p>`repeated.items.string.pattern`: `^[a-z0-9](?:[-]?[a-z0-9]){2,}$`</p> |
3947+
39323948
### <a name="ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest">Message `BatchUpdateEndDeviceLastSeenRequest`</a>
39333949

39343950
| Field | Type | Label | Description |
@@ -9433,12 +9449,14 @@ The NsEndDeviceBatchRegistry service allows clients to manage batches of end dev
94339449
| Method Name | Request Type | Response Type | Description |
94349450
| ----------- | ------------ | ------------- | ------------|
94359451
| `Delete` | [`BatchDeleteEndDevicesRequest`](#ttn.lorawan.v3.BatchDeleteEndDevicesRequest) | [`.google.protobuf.Empty`](#google.protobuf.Empty) | Delete a list of devices within the same application. This operation is atomic; either all devices are deleted or none. Devices not found are skipped and no error is returned. |
9452+
| `SetMACSettingsProfile` | [`BatchSetMACSettingsProfileRequest`](#ttn.lorawan.v3.BatchSetMACSettingsProfileRequest) | [`EndDevices`](#ttn.lorawan.v3.EndDevices) | Set the MAC settings profile for a batch of end devices. |
94369453

94379454
#### HTTP bindings
94389455

94399456
| Method Name | Method | Pattern | Body |
94409457
| ----------- | ------ | ------- | ---- |
94419458
| `Delete` | `DELETE` | `/api/v3/ns/applications/{application_ids.application_id}/devices/batch` | |
9459+
| `SetMACSettingsProfile` | `POST` | `/api/v3/ns/applications/{application_ids.application_id}/devices/mac_settings_profile/batch` | `*` |
94429460

94439461
### <a name="ttn.lorawan.v3.NsEndDeviceRegistry">Service `NsEndDeviceRegistry`</a>
94449462

api/ttn/lorawan/v3/api.swagger.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10194,6 +10194,45 @@
1019410194
]
1019510195
}
1019610196
},
10197+
"/ns/applications/{application_ids.application_id}/devices/mac_settings_profile/batch": {
10198+
"post": {
10199+
"summary": "Set the MAC settings profile for a batch of end devices.",
10200+
"operationId": "NsEndDeviceBatchRegistry_SetMACSettingsProfile",
10201+
"responses": {
10202+
"200": {
10203+
"description": "A successful response.",
10204+
"schema": {
10205+
"$ref": "#/definitions/v3EndDevices"
10206+
}
10207+
},
10208+
"default": {
10209+
"description": "An unexpected error response.",
10210+
"schema": {
10211+
"$ref": "#/definitions/googlerpcStatus"
10212+
}
10213+
}
10214+
},
10215+
"parameters": [
10216+
{
10217+
"name": "application_ids.application_id",
10218+
"in": "path",
10219+
"required": true,
10220+
"type": "string"
10221+
},
10222+
{
10223+
"name": "body",
10224+
"in": "body",
10225+
"required": true,
10226+
"schema": {
10227+
"$ref": "#/definitions/NsEndDeviceBatchRegistrySetMACSettingsProfileBody"
10228+
}
10229+
}
10230+
],
10231+
"tags": [
10232+
"NsEndDeviceBatchRegistry"
10233+
]
10234+
}
10235+
},
1019710236
"/ns/applications/{application_ids.application_id}/devices/{device_id}": {
1019810237
"delete": {
1019910238
"summary": "Delete deletes the device that matches the given identifiers.\nIf there are multiple matches, an error will be returned.",
@@ -18867,6 +18906,23 @@
1886718906
}
1886818907
}
1886918908
},
18909+
"NsEndDeviceBatchRegistrySetMACSettingsProfileBody": {
18910+
"type": "object",
18911+
"properties": {
18912+
"application_ids": {
18913+
"type": "object"
18914+
},
18915+
"mac_settings_profile_ids": {
18916+
"$ref": "#/definitions/v3MACSettingsProfileIdentifiers"
18917+
},
18918+
"device_ids": {
18919+
"type": "array",
18920+
"items": {
18921+
"type": "string"
18922+
}
18923+
}
18924+
}
18925+
},
1887018926
"NsEndDeviceRegistryResetFactoryDefaultsBody": {
1887118927
"type": "object",
1887218928
"properties": {

api/ttn/lorawan/v3/end_device.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,3 +1435,18 @@ message BatchGetEndDevicesRequest {
14351435
reserved 6;
14361436
reserved "page";
14371437
}
1438+
1439+
message BatchSetMACSettingsProfileRequest {
1440+
ttn.lorawan.v3.ApplicationIdentifiers application_ids = 1 [(validate.rules).message.required = true];
1441+
MACSettingsProfileIdentifiers mac_settings_profile_ids = 2;
1442+
repeated string device_ids = 3 [(validate.rules).repeated = {
1443+
min_items: 1,
1444+
max_items: 20,
1445+
items: {
1446+
string: {
1447+
pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$",
1448+
max_len: 36
1449+
}
1450+
}
1451+
}];
1452+
}

api/ttn/lorawan/v3/networkserver.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,12 @@ service NsEndDeviceBatchRegistry {
182182
rpc Delete(BatchDeleteEndDevicesRequest) returns (google.protobuf.Empty) {
183183
option (google.api.http) = {delete: "/ns/applications/{application_ids.application_id}/devices/batch"};
184184
}
185+
186+
// Set the MAC settings profile for a batch of end devices.
187+
rpc SetMACSettingsProfile(BatchSetMACSettingsProfileRequest) returns (EndDevices) {
188+
option (google.api.http) = {
189+
post: "/ns/applications/{application_ids.application_id}/devices/mac_settings_profile/batch"
190+
body: "*"
191+
};
192+
}
185193
}

0 commit comments

Comments
 (0)