Skip to content

Commit

Permalink
Merge pull request #6329 from TheThingsNetwork/feature/3632-batch-del…
Browse files Browse the repository at this point in the history
…ete-devices

Backport end device batch deletion
  • Loading branch information
KrishnaIyer authored Jul 6, 2023
2 parents 9219ac1 + c71db28 commit d1fb150
Show file tree
Hide file tree
Showing 64 changed files with 5,455 additions and 489 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ For details about compatibility between different releases, see the **Commitment
### Added

- The `as-db purge` command to purge unused data from the Application Server database.
- RPCs and CLI command to delete a batch of end devices within an application.
- Check `ttn-lw-cli end-devices batch-delete` for more details.

### Changed

Expand Down
83 changes: 83 additions & 0 deletions api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- [Enum `AsConfiguration.PubSub.Providers.Status`](#ttn.lorawan.v3.AsConfiguration.PubSub.Providers.Status)
- [Service `AppAs`](#ttn.lorawan.v3.AppAs)
- [Service `As`](#ttn.lorawan.v3.As)
- [Service `AsEndDeviceBatchRegistry`](#ttn.lorawan.v3.AsEndDeviceBatchRegistry)
- [Service `AsEndDeviceRegistry`](#ttn.lorawan.v3.AsEndDeviceRegistry)
- [Service `NsAs`](#ttn.lorawan.v3.NsAs)
- [File `lorawan-stack/api/applicationserver_integrations_alcsync.proto`](#lorawan-stack/api/applicationserver_integrations_alcsync.proto)
Expand Down Expand Up @@ -222,6 +223,7 @@
- [Message `ADRSettings.DynamicMode.ChannelSteeringSettings.DisabledMode`](#ttn.lorawan.v3.ADRSettings.DynamicMode.ChannelSteeringSettings.DisabledMode)
- [Message `ADRSettings.DynamicMode.ChannelSteeringSettings.LoRaNarrowMode`](#ttn.lorawan.v3.ADRSettings.DynamicMode.ChannelSteeringSettings.LoRaNarrowMode)
- [Message `ADRSettings.StaticMode`](#ttn.lorawan.v3.ADRSettings.StaticMode)
- [Message `BatchDeleteEndDevicesRequest`](#ttn.lorawan.v3.BatchDeleteEndDevicesRequest)
- [Message `BatchUpdateEndDeviceLastSeenRequest`](#ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest)
- [Message `BatchUpdateEndDeviceLastSeenRequest.EndDeviceLastSeenUpdate`](#ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest.EndDeviceLastSeenUpdate)
- [Message `BoolValue`](#ttn.lorawan.v3.BoolValue)
Expand Down Expand Up @@ -264,6 +266,7 @@
- [Message `UpdateEndDeviceRequest`](#ttn.lorawan.v3.UpdateEndDeviceRequest)
- [Enum `PowerState`](#ttn.lorawan.v3.PowerState)
- [File `lorawan-stack/api/end_device_services.proto`](#lorawan-stack/api/end_device_services.proto)
- [Service `EndDeviceBatchRegistry`](#ttn.lorawan.v3.EndDeviceBatchRegistry)
- [Service `EndDeviceRegistry`](#ttn.lorawan.v3.EndDeviceRegistry)
- [Service `EndDeviceTemplateConverter`](#ttn.lorawan.v3.EndDeviceTemplateConverter)
- [File `lorawan-stack/api/enums.proto`](#lorawan-stack/api/enums.proto)
Expand Down Expand Up @@ -337,6 +340,7 @@
- [Message `ApplicationIdentifiers`](#ttn.lorawan.v3.ApplicationIdentifiers)
- [Message `ClientIdentifiers`](#ttn.lorawan.v3.ClientIdentifiers)
- [Message `EndDeviceIdentifiers`](#ttn.lorawan.v3.EndDeviceIdentifiers)
- [Message `EndDeviceIdentifiersList`](#ttn.lorawan.v3.EndDeviceIdentifiersList)
- [Message `EndDeviceVersionIdentifiers`](#ttn.lorawan.v3.EndDeviceVersionIdentifiers)
- [Message `EntityIdentifiers`](#ttn.lorawan.v3.EntityIdentifiers)
- [Message `GatewayIdentifiers`](#ttn.lorawan.v3.GatewayIdentifiers)
Expand Down Expand Up @@ -392,6 +396,7 @@
- [Service `ApplicationCryptoService`](#ttn.lorawan.v3.ApplicationCryptoService)
- [Service `AsJs`](#ttn.lorawan.v3.AsJs)
- [Service `Js`](#ttn.lorawan.v3.Js)
- [Service `JsEndDeviceBatchRegistry`](#ttn.lorawan.v3.JsEndDeviceBatchRegistry)
- [Service `JsEndDeviceRegistry`](#ttn.lorawan.v3.JsEndDeviceRegistry)
- [Service `NetworkCryptoService`](#ttn.lorawan.v3.NetworkCryptoService)
- [Service `NsJs`](#ttn.lorawan.v3.NsJs)
Expand Down Expand Up @@ -527,6 +532,7 @@
- [Service `AsNs`](#ttn.lorawan.v3.AsNs)
- [Service `GsNs`](#ttn.lorawan.v3.GsNs)
- [Service `Ns`](#ttn.lorawan.v3.Ns)
- [Service `NsEndDeviceBatchRegistry`](#ttn.lorawan.v3.NsEndDeviceBatchRegistry)
- [Service `NsEndDeviceRegistry`](#ttn.lorawan.v3.NsEndDeviceRegistry)
- [File `lorawan-stack/api/notification_service.proto`](#lorawan-stack/api/notification_service.proto)
- [Message `CreateNotificationRequest`](#ttn.lorawan.v3.CreateNotificationRequest)
Expand Down Expand Up @@ -1214,6 +1220,20 @@ The As service manages the Application Server.
| `GetLinkStats` | `GET` | `/api/v3/as/applications/{application_id}/link/stats` | |
| `GetConfiguration` | `GET` | `/api/v3/as/configuration` | |

### <a name="ttn.lorawan.v3.AsEndDeviceBatchRegistry">Service `AsEndDeviceBatchRegistry`</a>

The AsEndDeviceBatchRegistry service allows clients to manage batches end devices on the Application Server.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| `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. |

#### HTTP bindings

| Method Name | Method | Pattern | Body |
| ----------- | ------ | ------- | ---- |
| `Delete` | `DELETE` | `/api/v3/as/applications/{application_ids.application_id}/devices/batch` | |

### <a name="ttn.lorawan.v3.AsEndDeviceRegistry">Service `AsEndDeviceRegistry`</a>

The AsEndDeviceRegistry service allows clients to manage their end devices on the Application Server.
Expand Down Expand Up @@ -3437,6 +3457,20 @@ Configuration options for static ADR.
| `tx_power_index` | <p>`uint32.lte`: `15`</p> |
| `nb_trans` | <p>`uint32.lte`: `15`</p><p>`uint32.gte`: `1`</p> |

### <a name="ttn.lorawan.v3.BatchDeleteEndDevicesRequest">Message `BatchDeleteEndDevicesRequest`</a>

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `application_ids` | [`ApplicationIdentifiers`](#ttn.lorawan.v3.ApplicationIdentifiers) | | |
| `device_ids` | [`string`](#string) | repeated | |

#### Field Rules

| Field | Validations |
| ----- | ----------- |
| `application_ids` | <p>`message.required`: `true`</p> |
| `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> |

### <a name="ttn.lorawan.v3.BatchUpdateEndDeviceLastSeenRequest">Message `BatchUpdateEndDeviceLastSeenRequest`</a>

| Field | Type | Label | Description |
Expand Down Expand Up @@ -4155,6 +4189,21 @@ Power state of the device.

## <a name="lorawan-stack/api/end_device_services.proto">File `lorawan-stack/api/end_device_services.proto`</a>

### <a name="ttn.lorawan.v3.EndDeviceBatchRegistry">Service `EndDeviceBatchRegistry`</a>

The EndDeviceBatchRegistry service, exposed by the Identity Server, is used to manage
end device registrations in batches.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| `Delete` | [`BatchDeleteEndDevicesRequest`](#ttn.lorawan.v3.BatchDeleteEndDevicesRequest) | [`.google.protobuf.Empty`](#google.protobuf.Empty) | Delete a batch of end devices with the given IDs. This operation is atomic; either all devices are deleted or none. Devices not found are skipped and no error is returned. Before calling this RPC, use the corresponding BatchDelete RPCs of NsEndDeviceRegistry, AsEndDeviceRegistry and optionally the JsEndDeviceRegistry to delete the end devices. If the devices were claimed on a Join Server, use the BatchUnclaim RPC of the DeviceClaimingServer. This is NOT done automatically. |

#### HTTP bindings

| Method Name | Method | Pattern | Body |
| ----------- | ------ | ------- | ---- |
| `Delete` | `DELETE` | `/api/v3/applications/{application_ids.application_id}/devices/batch` | |

### <a name="ttn.lorawan.v3.EndDeviceRegistry">Service `EndDeviceRegistry`</a>

The EndDeviceRegistry service, exposed by the Identity Server, is used to manage
Expand Down Expand Up @@ -5065,6 +5114,12 @@ The NsGs service connects a Network Server to a Gateway Server.
| `join_eui` | <p>`bytes.len`: `8`</p> |
| `dev_addr` | <p>`bytes.len`: `4`</p> |

### <a name="ttn.lorawan.v3.EndDeviceIdentifiersList">Message `EndDeviceIdentifiersList`</a>

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `end_device_ids` | [`EndDeviceIdentifiers`](#ttn.lorawan.v3.EndDeviceIdentifiers) | repeated | |

### <a name="ttn.lorawan.v3.EndDeviceVersionIdentifiers">Message `EndDeviceVersionIdentifiers`</a>

Identifies an end device model with version information.
Expand Down Expand Up @@ -5705,6 +5760,20 @@ The AsJs service connects an Application Server to a Join Server.
| `GetJoinEUIPrefixes` | `GET` | `/api/v3/js/join_eui_prefixes` | |
| `GetDefaultJoinEUI` | `GET` | `/api/v3/js/default_join_eui` | |

### <a name="ttn.lorawan.v3.JsEndDeviceBatchRegistry">Service `JsEndDeviceBatchRegistry`</a>

JsEndDeviceBatchRegistry service allows clients to manage batches of end devices on the Join Server.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| `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. |

#### HTTP bindings

| Method Name | Method | Pattern | Body |
| ----------- | ------ | ------- | ---- |
| `Delete` | `DELETE` | `/api/v3/js/applications/{application_ids.application_id}/devices/batch` | |

### <a name="ttn.lorawan.v3.JsEndDeviceRegistry">Service `JsEndDeviceRegistry`</a>

The JsEndDeviceRegistry service allows clients to manage their end devices on the Join Server.
Expand Down Expand Up @@ -7604,6 +7673,20 @@ The Ns service manages the Network Server.
| `GetNetID` | `GET` | `/api/v3/ns/net_id` | |
| `GetDeviceAddressPrefixes` | `GET` | `/api/v3/ns/dev_addr_prefixes` | |

### <a name="ttn.lorawan.v3.NsEndDeviceBatchRegistry">Service `NsEndDeviceBatchRegistry`</a>

The NsEndDeviceBatchRegistry service allows clients to manage batches of end devices on the Network Server.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| `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. |

#### HTTP bindings

| Method Name | Method | Pattern | Body |
| ----------- | ------ | ------- | ---- |
| `Delete` | `DELETE` | `/api/v3/ns/applications/{application_ids.application_id}/devices/batch` | |

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

The NsEndDeviceRegistry service allows clients to manage their end devices on the Network Server.
Expand Down
Loading

0 comments on commit d1fb150

Please sign in to comment.