Update Python SDK.

This commit is contained in:
Orne Brocaar
2022-07-18 14:14:28 +01:00
parent 626af4fadc
commit 038614b44d
42 changed files with 2884 additions and 1179 deletions

View File

@ -2,144 +2,367 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "ApplicationProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
// ApplicationService is the service providing API methods for managing applications.
service ApplicationService {
// Create creates the given application.
rpc Create(CreateApplicationRequest) returns (CreateApplicationResponse) {}
rpc Create(CreateApplicationRequest) returns (CreateApplicationResponse) {
option(google.api.http) = {
post: "/api/applications"
body: "*"
};
}
// Get the application for the given ID.
rpc Get(GetApplicationRequest) returns (GetApplicationResponse) {}
rpc Get(GetApplicationRequest) returns (GetApplicationResponse) {
option(google.api.http) = {
get: "/api/applications/{id}"
};
}
// Update updates the given application.
rpc Update(UpdateApplicationRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateApplicationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{application.id}"
body: "*"
};
}
// Delete the application for the given ID.
rpc Delete(DeleteApplicationRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteApplicationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{id}"
};
}
// Get the list of applications.
rpc List(ListApplicationsRequest) returns (ListApplicationsResponse) {}
rpc List(ListApplicationsRequest) returns (ListApplicationsResponse) {
option(google.api.http) = {
get: "/api/applications"
};
}
// List all configured integrations.
rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) {}
rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations"
};
}
// Create HTTP integration.
rpc CreateHttpIntegration(CreateHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateHttpIntegration(CreateHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/http"
body: "*"
};
}
// Get the configured HTTP integration.
rpc GetHttpIntegration(GetHttpIntegrationRequest) returns (GetHttpIntegrationResponse) {}
rpc GetHttpIntegration(GetHttpIntegrationRequest) returns (GetHttpIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/http"
};
}
// Update the HTTP integration.
rpc UpdateHttpIntegration(UpdateHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateHttpIntegration(UpdateHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/http"
body: "*"
};
}
// Delete the HTTP integration.
rpc DeleteHttpIntegration(DeleteHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteHttpIntegration(DeleteHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/http"
};
}
// Create InfluxDb integration.
rpc CreateInfluxDbIntegration(CreateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateInfluxDbIntegration(CreateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/influxdb"
body: "*"
};
}
// Get InfluxDb integration.
rpc GetInfluxDbIntegration(GetInfluxDbIntegrationRequest) returns (GetInfluxDbIntegrationResponse) {}
rpc GetInfluxDbIntegration(GetInfluxDbIntegrationRequest) returns (GetInfluxDbIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/influxdb"
};
}
// Update InfluxDb integration.
rpc UpdateInfluxDbIntegration(UpdateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateInfluxDbIntegration(UpdateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/influxdb"
body: "*"
};
}
// Delete InfluxDb integration.
rpc DeleteInfluxDbIntegration(DeleteInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteInfluxDbIntegration(DeleteInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/influxdb"
};
}
// Create ThingsBoard integration.
rpc CreateThingsBoardIntegration(CreateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateThingsBoardIntegration(CreateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/thingsboard"
body: "*"
};
}
// Get ThingsBoard integration.
rpc GetThingsBoardIntegration(GetThingsBoardIntegrationRequest) returns (GetThingsBoardIntegrationResponse) {}
rpc GetThingsBoardIntegration(GetThingsBoardIntegrationRequest) returns (GetThingsBoardIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/thingsboard"
};
}
// Update ThingsBoard integration.
rpc UpdateThingsBoardIntegration(UpdateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateThingsBoardIntegration(UpdateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/thingsboard"
body: "*"
};
}
// Delete ThingsBoard integration.
rpc DeleteThingsBoardIntegration(DeleteThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteThingsBoardIntegration(DeleteThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/thingsboard"
};
}
// Create myDevices integration.
rpc CreateMyDevicesIntegration(CreateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateMyDevicesIntegration(CreateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/mydevices"
body: "*"
};
}
// Get myDevices integration.
rpc GetMyDevicesIntegration(GetMyDevicesIntegrationRequest) returns (GetMyDevicesIntegrationResponse) {}
rpc GetMyDevicesIntegration(GetMyDevicesIntegrationRequest) returns (GetMyDevicesIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/mydevices"
};
}
// Update myDevices integration.
rpc UpdateMyDevicesIntegration(UpdateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateMyDevicesIntegration(UpdateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/mydevices"
body: "*"
};
}
// Delete myDevices integration.
rpc DeleteMyDevicesIntegration(DeleteMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteMyDevicesIntegration(DeleteMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/mydevices"
};
}
// Create LoRaCloud integration.
rpc CreateLoraCloudIntegration(CreateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateLoraCloudIntegration(CreateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/loracloud"
body: "*"
};
}
// Get LoRaCloud integration.
rpc GetLoraCloudIntegration(GetLoraCloudIntegrationRequest) returns (GetLoraCloudIntegrationResponse) {}
rpc GetLoraCloudIntegration(GetLoraCloudIntegrationRequest) returns (GetLoraCloudIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/loracloud"
};
}
// Update LoRaCloud integration.
rpc UpdateLoraCloudIntegration(UpdateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateLoraCloudIntegration(UpdateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/loracloud"
body: "*"
};
}
// Delete LoRaCloud integration.
rpc DeleteLoraCloudIntegration(DeleteLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteLoraCloudIntegration(DeleteLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/loracloud"
};
}
// Create GCP Pub/Sub integration.
rpc CreateGcpPubSubIntegration(CreateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateGcpPubSubIntegration(CreateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
body: "*"
};
}
// Get GCP Pub/Sub integration.
rpc GetGcpPubSubIntegration(GetGcpPubSubIntegrationRequest) returns (GetGcpPubSubIntegrationResponse) {}
rpc GetGcpPubSubIntegration(GetGcpPubSubIntegrationRequest) returns (GetGcpPubSubIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/gcp-pub-sub"
};
}
// Update GCP Pub/Sub integration.
rpc UpdateGcpPubSubIntegration(UpdateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateGcpPubSubIntegration(UpdateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
body: "*"
};
}
// Delete GCP Pub/Sub integration.
rpc DeleteGcpPubSubIntegration(DeleteGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteGcpPubSubIntegration(DeleteGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/gcp-pub-sub"
};
}
// Create AWS SNS integration.
rpc CreateAwsSnsIntegration(CreateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateAwsSnsIntegration(CreateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/aws-sns"
body: "*"
};
}
// Get AWS SNS integration.
rpc GetAwsSnsIntegration(GetAwsSnsIntegrationRequest) returns (GetAwsSnsIntegrationResponse) {}
rpc GetAwsSnsIntegration(GetAwsSnsIntegrationRequest) returns (GetAwsSnsIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/aws-sns"
};
}
// Update AWS SNS integration.
rpc UpdateAwsSnsIntegration(UpdateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateAwsSnsIntegration(UpdateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/aws-sns"
body: "*"
};
}
// Delete AWS SNS integration.
rpc DeleteAwsSnsIntegration(DeleteAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteAwsSnsIntegration(DeleteAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/aws-sns"
};
}
// Create Azure Service-Bus integration.
rpc CreateAzureServiceBusIntegration(CreateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateAzureServiceBusIntegration(CreateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
body: "*"
};
}
// Get Azure Service-Bus integration.
rpc GetAzureServiceBusIntegration(GetAzureServiceBusIntegrationRequest) returns (GetAzureServiceBusIntegrationResponse) {}
rpc GetAzureServiceBusIntegration(GetAzureServiceBusIntegrationRequest) returns (GetAzureServiceBusIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/azure-service-bus"
};
}
// Update Azure Service-Bus integration.
rpc UpdateAzureServiceBusIntegration(UpdateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateAzureServiceBusIntegration(UpdateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
body: "*"
};
}
// Delete Azure Service-Bus integration.
rpc DeleteAzureServiceBusIntegration(DeleteAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteAzureServiceBusIntegration(DeleteAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/azure-service-bus"
};
}
// Create Pilot Things integration.
rpc CreatePilotThingsIntegration(CreatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreatePilotThingsIntegration(CreatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/pilot-things"
body: "*"
};
}
// Get Pilot Things integration.
rpc GetPilotThingsIntegration(GetPilotThingsIntegrationRequest) returns (GetPilotThingsIntegrationResponse) {}
rpc GetPilotThingsIntegration(GetPilotThingsIntegrationRequest) returns (GetPilotThingsIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/pilot-things"
};
}
// Update Pilot Things integration.
rpc UpdatePilotThingsIntegration(UpdatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdatePilotThingsIntegration(UpdatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/pilot-things"
body: "*"
};
}
// Delete Pilot Things integration.
rpc DeletePilotThingsIntegration(DeletePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeletePilotThingsIntegration(DeletePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/pilot-things"
};
}
// Create IFTTT integration.
rpc CreateIftttIntegration(CreateIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/ifttt"
body: "*"
};
}
// Get IFTTT integration.
rpc GetIftttIntegration(GetIftttIntegrationRequest) returns (GetIftttIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/ifttt"
};
}
// Update IFTTT integration.
rpc UpdateIftttIntegration(UpdateIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/ifttt"
body: "*"
};
}
// Delete IFTTT integration.
rpc DeleteIftttIntegration(DeleteIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/ifttt"
};
}
// Generates application ID specific client-certificate.
rpc GenerateMqttIntegrationClientCertificate(GenerateMqttIntegrationClientCertificateRequest) returns (GenerateMqttIntegrationClientCertificateResponse) {}
rpc GenerateMqttIntegrationClientCertificate(GenerateMqttIntegrationClientCertificateRequest) returns (GenerateMqttIntegrationClientCertificateResponse) {
option(google.api.http) = {
post: "/api/applications/{application_id}/integrations/mqtt/certificate"
};
}
}
enum Encoding {
@ -158,6 +381,7 @@ enum IntegrationKind {
AZURE_SERVICE_BUS = 7;
PILOT_THINGS = 8;
MQTT_GLOBAL = 9;
IFTTT = 10;
}
message Application {
@ -216,6 +440,11 @@ message GetApplicationResponse {
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
// Measurement keys.
// This contains the measurement keys from all the device-profiles that
// are used by the devices under this application.
repeated string measurement_keys = 4;
}
message UpdateApplicationRequest {
@ -718,6 +947,53 @@ message DeletePilotThingsIntegrationRequest {
string application_id = 1;
}
message IftttIntegration {
// Application ID (UUID).
string application_id = 1;
// Key.
// This key can be obtained from the IFTTT Webhooks documentation page.
string key = 2;
// Values.
// Up to 2 values can be forwarded to IFTTT. These values must map to the
// decoded payload keys. For example:
// {
// "batteryLevel": 75.3,
// "buttons": [{"pressed": false}, {"pressed": true}]
// }
// You would specify the following fields:
// uplink_values = ["batteryLevel", "buttons_0_pressed"]
//
// Note: The first value is always used for the DevEUI.
repeated string uplink_values = 3;
}
message CreateIftttIntegrationRequest {
// Integration object.
IftttIntegration integration = 1;
}
message GetIftttIntegrationRequest {
// Application ID (UUID).
string application_id = 1;
}
message GetIftttIntegrationResponse {
// Integration object.
IftttIntegration integration = 1;
}
message UpdateIftttIntegrationRequest {
// Integration object to update.
IftttIntegration integration = 1;
}
message DeleteIftttIntegrationRequest {
// Application ID (UUID).
string application_id = 1;
}
message GenerateMqttIntegrationClientCertificateRequest {
// Application ID (UUID).
string application_id = 1;

View File

@ -2,11 +2,13 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProto";
import "chirpstack-api/common/common.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/empty.proto";
@ -14,58 +16,145 @@ import "google/protobuf/empty.proto";
// DeviceService is the service providing API methods for managing devices.
service DeviceService {
// Create the given device.
rpc Create(CreateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Create(CreateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices"
body: "*"
};
}
// Get returns the device for the given DevEUI.
rpc Get(GetDeviceRequest) returns (GetDeviceResponse) {}
rpc Get(GetDeviceRequest) returns (GetDeviceResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}"
};
}
// Update the given device.
rpc Update(UpdateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/devices/{device.dev_eui}"
body: "*"
};
}
// Delete the device with the given DevEUI.
rpc Delete(DeleteDeviceRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}"
};
}
// Get the list of devices.
rpc List(ListDevicesRequest) returns (ListDevicesResponse) {}
rpc List(ListDevicesRequest) returns (ListDevicesResponse) {
option(google.api.http) = {
get: "/api/devices"
};
}
// Create the given device-keys.
rpc CreateKeys(CreateDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc CreateKeys(CreateDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices/{device_keys.dev_eui}/keys"
body: "*"
};
}
// Get the device-keys for the given DevEUI.
rpc GetKeys(GetDeviceKeysRequest) returns (GetDeviceKeysResponse) {}
rpc GetKeys(GetDeviceKeysRequest) returns (GetDeviceKeysResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/keys"
};
}
// Update the given device-keys.
rpc UpdateKeys(UpdateDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc UpdateKeys(UpdateDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/devices/{device_keys.dev_eui}/keys"
body: "*"
};
}
// Delete the device-keys for the given DevEUI.
rpc DeleteKeys(DeleteDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc DeleteKeys(DeleteDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/keys"
};
}
// FlushDevNonces flushes the OTAA device nonces.
rpc FlushDevNonces(FlushDevNoncesRequest) returns (google.protobuf.Empty) {}
rpc FlushDevNonces(FlushDevNoncesRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/dev-nonces"
};
}
// Activate (re)activates the device with the given parameters (for ABP or for importing OTAA activations).
rpc Activate(ActivateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Activate(ActivateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices/{device_activation.dev_eui}/activate"
body: "*"
};
}
// Deactivate de-activates the device.
rpc Deactivate(DeactivateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Deactivate(DeactivateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/activation"
};
}
// GetActivation returns the current activation details of the device (OTAA or ABP).
rpc GetActivation(GetDeviceActivationRequest) returns (GetDeviceActivationResponse) {}
rpc GetActivation(GetDeviceActivationRequest) returns (GetDeviceActivationResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/activation"
};
}
// GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account.
rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {}
rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {
option(google.api.http) = {
post: "/api/devices/{dev_eui}/get-random-dev-addr"
};
}
// GetStats returns the device stats.
rpc GetStats(GetDeviceStatsRequest) returns (GetDeviceStatsResponse) {}
// GetMetrics returns the device metrics.
// Note that this requires a device-profile with codec and measurements configured.
rpc GetMetrics(GetDeviceMetricsRequest) returns (GetDeviceMetricsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/metrics"
};
}
// GetLinkMetrics returns the device link metrics.
// This includes uplinks, downlinks, RSSI, SNR, etc...
rpc GetLinkMetrics(GetDeviceLinkMetricsRequest) returns (GetDeviceLinkMetricsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/link-metrics"
};
}
// Enqueue adds the given item to the downlink queue.
rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {}
rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {
option(google.api.http) = {
post: "/api/devices/{queue_item.dev_eui}/queue"
body: "*"
};
}
// FlushQueue flushes the downlink device-queue.
rpc FlushQueue(FlushDeviceQueueRequest) returns (google.protobuf.Empty) {}
rpc FlushQueue(FlushDeviceQueueRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/queue"
};
}
// GetQueue returns the downlink device-queue.
rpc GetQueue(GetDeviceQueueItemsRequest) returns (GetDeviceQueueItemsResponse) {}
rpc GetQueue(GetDeviceQueueItemsRequest) returns (GetDeviceQueueItemsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/queue"
};
}
}
message Device {
@ -309,7 +398,7 @@ message GetRandomDevAddrResponse {
string dev_addr = 1;
}
message GetDeviceStatsRequest {
message GetDeviceMetricsRequest {
// DevEUI (EUI64).
string dev_eui = 1;
@ -318,33 +407,57 @@ message GetDeviceStatsRequest {
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetDeviceStatsResponse {
repeated DeviceStats result = 1;
message GetDeviceMetricsResponse {
map<string, common.Metric> metrics = 1;
map<string, DeviceState> states = 2;
}
message DeviceStats {
// Timestamp of the (aggregated) measurement.
google.protobuf.Timestamp time = 1;
message DeviceState {
// Name.
string name = 2;
// Value.
string value = 3;
}
message GetDeviceLinkMetricsRequest {
// DevEUI (EUI64).
string dev_eui = 1;
// Interval start timestamp.
google.protobuf.Timestamp start = 2;
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetDeviceLinkMetricsResponse {
// Packets received from the device.
uint32 rx_packets = 2;
common.Metric rx_packets = 1;
// Average RSSI (as reported by the gateway(s)).
float gw_rssi = 3;
// RSSI (as reported by the gateway(s)).
common.Metric gw_rssi = 2;
// Average SNR (as reported by the gateway(s)).
float gw_snr = 4;
// SNR (as reported by the gateway(s)).
common.Metric gw_snr = 3;
// Packets received by frequency.
map<uint32, uint32> rx_packets_per_frequency = 5;
common.Metric rx_packets_per_freq = 4;
// Packets received by DR.
map<uint32, uint32> rx_packets_per_dr = 6;
common.Metric rx_packets_per_dr = 5;
// Error count.
map<string, uint32> errors = 7;
// Errors.
common.Metric errors = 6;
}
message DeviceQueueItem {
@ -379,7 +492,7 @@ message DeviceQueueItem {
}
message EnqueueDeviceQueueItemRequest {
DeviceQueueItem item = 1;
DeviceQueueItem queue_item = 1;
}
message EnqueueDeviceQueueItemResponse {

View File

@ -2,11 +2,12 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProfileProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
@ -22,25 +23,68 @@ enum CodecRuntime {
JS = 2;
}
enum MeasurementKind {
// Unknown (in which case it is not tracked).
UNKNOWN = 0;
// Incrementing counters that never decrease (these are not reset on each reading).
COUNTER = 1;
// Counters that do get reset upon reading.
ABSOLUTE = 2;
// E.g. a temperature value.
GAUGE = 3;
// E.g. a firmware version, true / false value.
STRING = 4;
}
// DeviceProfileService is the service providing API methods for managing device-profiles.
service DeviceProfileService {
// Create the given device-profile.
rpc Create(CreateDeviceProfileRequest) returns (CreateDeviceProfileResponse) {}
rpc Create(CreateDeviceProfileRequest) returns (CreateDeviceProfileResponse) {
option(google.api.http) = {
post: "/api/device-profiles"
body: "*"
};
}
// Get the device-profile for the given ID.
rpc Get(GetDeviceProfileRequest) returns (GetDeviceProfileResponse) {}
rpc Get(GetDeviceProfileRequest) returns (GetDeviceProfileResponse) {
option(google.api.http) = {
get: "/api/device-profiles/{id}"
};
}
// Update the given device-profile.
rpc Update(UpdateDeviceProfileRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/device-profiles/{device_profile.id}"
body: "*"
};
}
// Delete the device-profile with the given ID.
rpc Delete(DeleteDeviceProfileRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/device-profiles/{id}"
};
}
// List the available device-profiles.
rpc List(ListDeviceProfilesRequest) returns (ListDeviceProfilesResponse) {}
rpc List(ListDeviceProfilesRequest) returns (ListDeviceProfilesResponse) {
option(google.api.http) = {
get: "/api/device-profiles"
};
}
// List available ADR algorithms.
rpc ListAdrAlgorithms(google.protobuf.Empty) returns (ListDeviceProfileAdrAlgorithmsResponse) {}
rpc ListAdrAlgorithms(google.protobuf.Empty) returns (ListDeviceProfileAdrAlgorithmsResponse) {
option(google.api.http) = {
get: "/api/device-profiles/adr-algorithms"
};
}
}
message DeviceProfile {
@ -54,6 +98,9 @@ message DeviceProfile {
// Name.
string name = 3;
// Description.
string description = 26;
// Region.
common.Region region = 4;
@ -69,11 +116,11 @@ message DeviceProfile {
// Payload codec runtime.
CodecRuntime payload_codec_runtime = 8;
// Payload codec encoder config.
string payload_encoder_config = 9;
// Payload codec script.
string payload_codec_script = 9;
// Payload codec decoder config.
string payload_decoder_config = 10;
// Flush queue on device activation.
bool flush_queue_on_activate = 10;
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
@ -126,6 +173,18 @@ message DeviceProfile {
// User defined tags.
map<string, string> tags = 25;
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
map<string, Measurement> measurements = 27;
}
message Measurement {
// Name (user defined).
string name = 2;
// Kind.
MeasurementKind kind = 3;
}
message DeviceProfileListItem {

View File

@ -0,0 +1,234 @@
syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProfileTemplateProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
import "chirpstack-api/api/device_profile.proto";
// DeviceProfileTemplateService is the service providing API methods for managing device-profile templates.
service DeviceProfileTemplateService {
// Create the given device-profile template.
rpc Create(CreateDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/device-profile-templates"
body: "*"
};
}
// Get the device-profile template for the given ID.
rpc Get(GetDeviceProfileTemplateRequest) returns (GetDeviceProfileTemplateResponse) {
option(google.api.http) = {
get: "/api/device-profile-templates/{id}"
};
}
// Update the given device-profile template.
rpc Update(UpdateDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/device-profile-templates/{device_profile_template.id}"
body: "*"
};
}
// Delete the device-profile template with the given ID.
rpc Delete(DeleteDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/device-profile-templates/{id}"
};
}
// List the available device-profile templates.
rpc List(ListDeviceProfileTemplatesRequest) returns (ListDeviceProfileTemplatesResponse) {
option(google.api.http) = {
get: "/api/device-profile-templates"
};
}
}
message DeviceProfileTemplate {
// Device-profile template ID.
string id = 1;
// Name.
string name = 2;
// Description.
string description = 3;
// Vendor.
string vendor = 4;
// Firmware.
string firmware = 5;
// Region.
common.Region region = 6;
// LoRaWAN mac-version.
common.MacVersion mac_version = 7;
// Regional parameters revision.
common.RegParamsRevision reg_params_revision = 8;
// ADR algorithm ID.
string adr_algorithm_id = 9;
// Payload codec runtime.
CodecRuntime payload_codec_runtime = 10;
// Payload codec script.
string payload_codec_script = 11;
// Flush queue on device activation.
bool flush_queue_on_activate = 12;
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
// communication. When the uplink interval has expired and no uplink has
// been received, the device is considered inactive.
uint32 uplink_interval = 13;
// Device-status request interval (times / day).
// This defines the times per day that ChirpStack will request the device-status
// from the device.
uint32 device_status_req_interval = 14;
// Supports OTAA.
bool supports_otaa = 15;
// Supports Class B.
bool supports_class_b = 16;
// Supports Class-C.
bool supports_class_c = 17;
// Class-B timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
uint32 class_b_timeout = 18;
// Class-B ping-slot periodicity.
uint32 class_b_ping_slot_period = 19;
// Class-B ping-slot DR.
uint32 class_b_ping_slot_dr = 20;
// Class-B ping-slot freq (Hz).
uint32 class_b_ping_slot_freq = 21;
// Class-C timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
uint32 class_c_timeout = 22;
// RX1 delay (for ABP).
uint32 abp_rx1_delay = 23;
// RX1 DR offset (for ABP).
uint32 abp_rx1_dr_offset = 24;
// RX2 DR (for ABP).
uint32 abp_rx2_dr = 25;
// RX2 frequency (for ABP, Hz).
uint32 abp_rx2_freq = 26;
// User defined tags.
map<string, string> tags = 27;
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
map<string, Measurement> measurements = 28;
}
message DeviceProfileTemplateListItem {
// Device-profile template ID.
string id = 1;
// Created at timestamp.
google.protobuf.Timestamp created_at = 2;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
// Name.
string name = 4;
// Vendor.
string vendor = 5;
// Firmware.
string firmware = 6;
// Region.
common.Region region = 7;
// LoRaWAN mac-version.
common.MacVersion mac_version = 8;
// Regional parameters revision.
common.RegParamsRevision reg_params_revision = 9;
// Supports OTAA.
bool supports_otaa = 10;
// Supports Class-B.
bool supports_class_b = 11;
// Supports Class-C.
bool supports_class_c = 12;
}
message CreateDeviceProfileTemplateRequest {
// Object to create.
DeviceProfileTemplate device_profile_template = 1;
}
message GetDeviceProfileTemplateRequest {
// ID.
string id = 1;
}
message GetDeviceProfileTemplateResponse {
// Device-profile template object.
DeviceProfileTemplate device_profile_template = 1;
// Created at timestamp.
google.protobuf.Timestamp created_at = 2;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
}
message UpdateDeviceProfileTemplateRequest {
// Object to update.
DeviceProfileTemplate device_profile_template = 1;
}
message DeleteDeviceProfileTemplateRequest {
// ID.
string id = 1;
}
message ListDeviceProfileTemplatesRequest {
// Max number of device-profile templates to return in the result-set.
uint32 limit = 1;
// Offset in the result-set (for pagination).
uint32 offset = 2;
}
message ListDeviceProfileTemplatesResponse {
// Total number of device-profile templates.
uint32 total_count = 1;
// Result-set.
repeated DeviceProfileTemplateListItem result = 2;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "FrameLogProto";
@ -16,10 +16,10 @@ message UplinkFrameLog {
bytes phy_payload = 1;
// TX meta-data.
gw.UplinkTXInfo tx_info = 2;
gw.UplinkTxInfo tx_info = 2;
// RX meta-data.
repeated gw.UplinkRXInfo rx_info = 3;
repeated gw.UplinkRxInfo rx_info = 3;
// Message type.
common.MType m_type = 4;
@ -42,10 +42,10 @@ message DownlinkFrameLog {
bytes phy_payload = 2;
// TX meta-data.
gw.DownlinkTXInfo tx_info = 3;
gw.DownlinkTxInfo tx_info = 3;
// Downlink ID (UUID).
string downlink_id = 4;
// Downlink ID.
uint32 downlink_id = 4;
// Gateway ID (EUI64).
string gateway_id = 5;

View File

@ -2,37 +2,68 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "GatewayProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
// GatewayService is the service providing API methods for managing gateways.
service GatewayService {
// Create creates the given gateway.
rpc Create(CreateGatewayRequest) returns (google.protobuf.Empty) {}
// Create creates the given gateway.
rpc Create(CreateGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/gateways"
body: "*"
};
}
// Get returns the gateway for the given Gateway ID.
rpc Get(GetGatewayRequest) returns (GetGatewayResponse) {}
// Get returns the gateway for the given Gateway ID.
rpc Get(GetGatewayRequest) returns (GetGatewayResponse) {
option(google.api.http) = {
get: "/api/gateways/{gateway_id}"
};
}
// Update updates the given gateway.
rpc Update(UpdateGatewayRequest) returns (google.protobuf.Empty) {}
// Update updates the given gateway.
rpc Update(UpdateGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/gateways/{gateway.gateway_id}"
body: "*"
};
}
// Delete deletes the gateway matching the given Gateway ID.
rpc Delete(DeleteGatewayRequest) returns (google.protobuf.Empty) {}
// Delete deletes the gateway matching the given Gateway ID.
rpc Delete(DeleteGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/gateways/{gateway_id}"
};
}
// Get the list of gateways.
rpc List(ListGatewaysRequest) returns (ListGatewaysResponse) {}
// Get the list of gateways.
rpc List(ListGatewaysRequest) returns (ListGatewaysResponse) {
option(google.api.http) = {
get: "/api/gateways"
};
}
// Generate client-certificate for the gateway.
rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {}
// Generate client-certificate for the gateway.
rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {
option(google.api.http) = {
post: "/api/gateways/{gateway_id}/generate-certificate"
};
}
// GetStats returns the gateway stats.
rpc GetStats(GetGatewayStatsRequest) returns (GetGatewayStatsResponse) {}
// GetMetrics returns the gateway metrics.
rpc GetMetrics(GetGatewayMetricsRequest) returns (GetGatewayMetricsResponse) {
option(google.api.http) = {
get: "/api/gateways/{gateway_id}/metrics"
};
}
}
message Gateway {
@ -163,7 +194,7 @@ message GenerateGatewayClientCertificateResponse {
google.protobuf.Timestamp expires_at = 4;
}
message GetGatewayStatsRequest {
message GetGatewayMetricsRequest {
// Gateway ID (EUI64).
string gateway_id = 1;
@ -172,34 +203,30 @@ message GetGatewayStatsRequest {
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetGatewayStatsResponse {
repeated GatewayStats result = 1;
}
message GatewayStats {
// Timestamp of the (aggregated) measurement.
google.protobuf.Timestamp time = 1;
// Packets received.
uint32 rx_packets = 2;
// Packets emitted.
uint32 tx_packets = 3;
// Tx packets per frequency.
map<uint32, uint32> tx_packets_per_frequency = 4;
// Rx packets per frequency.
map<uint32, uint32> rx_packets_per_frequency = 5;
// Tx packets per DR.
map<uint32, uint32> tx_packets_per_dr = 6;
// Rx packets per DR.
map<uint32, uint32> rx_packets_per_dr = 7;
// Tx packets per status.
map<string, uint32> tx_packets_per_status = 8;
message GetGatewayMetricsResponse {
// RX packets.
common.Metric rx_packets = 1;
// TX packets.
common.Metric tx_packets = 2;
// TX packets / frequency.
common.Metric tx_packets_per_freq = 3;
// RX packets / frequency.
common.Metric rx_packets_per_freq = 4;
// TX packets / DR.
common.Metric tx_packets_per_dr = 5;
// RX packets / DR.
common.Metric rx_packets_per_dr = 6;
// TX packets per status.
common.Metric tx_packets_per_status = 7;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "InternalProto";

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "MulticastGroupProto";
@ -16,34 +16,78 @@ import "chirpstack-api/common/common.proto";
// MulticastGroupService is the service managing multicast-groups.
service MulticastGroupService {
// Create the given multicast group.
rpc Create(CreateMulticastGroupRequest) returns (CreateMulticastGroupResponse) {}
rpc Create(CreateMulticastGroupRequest) returns (CreateMulticastGroupResponse) {
option(google.api.http) = {
post: "/api/multicast-groups"
body: "*"
};
}
// Get returns the multicast group for the given ID.
rpc Get(GetMulticastGroupRequest) returns (GetMulticastGroupResponse) {}
rpc Get(GetMulticastGroupRequest) returns (GetMulticastGroupResponse) {
option(google.api.http) = {
get: "/api/multicast-groups/{id}"
};
}
// Update the given multicast group.
rpc Update(UpdateMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/multicast-groups/{multicast_group.id}"
body: "*"
};
}
// Delete the multicast-group with the given ID.
rpc Delete(DeleteMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{id}"
};
}
// List the available multicast groups.
rpc List(ListMulticastGroupsRequest) returns (ListMulticastGroupsResponse) {}
rpc List(ListMulticastGroupsRequest) returns (ListMulticastGroupsResponse) {
option(google.api.http) = {
get: "/api/multicast-groups"
};
}
// Add a device to the multicast group.
rpc AddDevice(AddDeviceToMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc AddDevice(AddDeviceToMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/multicast-groups/{multicast_group_id}/devices"
body: "*"
};
}
// Remove a device from the multicast group.
rpc RemoveDevice(RemoveDeviceFromMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc RemoveDevice(RemoveDeviceFromMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{multicast_group_id}/devices/{dev_eui}"
};
}
// Add the given item to the multcast group queue.
rpc Enqueue(EnqueueMulticastGroupQueueItemRequest) returns (EnqueueMulticastGroupQueueItemResponse) {}
rpc Enqueue(EnqueueMulticastGroupQueueItemRequest) returns (EnqueueMulticastGroupQueueItemResponse) {
option(google.api.http) = {
post: "/api/multcast-groups/{queue_item.multicast_group_id}/queue"
body: "*"
};
}
// Flush the queue for the given multicast group.
rpc FlushQueue(FlushMulticastGroupQueueRequest) returns (google.protobuf.Empty) {}
rpc FlushQueue(FlushMulticastGroupQueueRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{multicast_group_id}/queue"
};
}
// List the items in the multicast group queue.
rpc ListQueue(ListMulticastGroupQueueRequest) returns (ListMulticastGroupQueueResponse) {}
rpc ListQueue(ListMulticastGroupQueueRequest) returns (ListMulticastGroupQueueResponse) {
option(google.api.http) = {
get: "/api/multicast-groups/{multicast_group_id}/queue"
};
}
}
enum MulticastGroupType {
@ -205,7 +249,7 @@ message MulticastGroupQueueItem {
message EnqueueMulticastGroupQueueItemRequest {
// Multicast queue-item to enqueue.
MulticastGroupQueueItem multicast_group_queue_item = 1;
MulticastGroupQueueItem queue_item = 1;
}
message EnqueueMulticastGroupQueueItemResponse {

View File

@ -2,46 +2,91 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "InternalProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
// TenantService is the service providing API methods for managing tenants.
service TenantService {
// Create a new tenant.
rpc Create(CreateTenantRequest) returns (CreateTenantResponse) {}
rpc Create(CreateTenantRequest) returns (CreateTenantResponse) {
option(google.api.http) = {
post: "/api/tenants"
body: "*"
};
}
// Get the tenant for the given ID.
rpc Get(GetTenantRequest) returns (GetTenantResponse) {}
rpc Get(GetTenantRequest) returns (GetTenantResponse) {
option(google.api.http) = {
get: "/api/tenants/{id}"
};
}
// Update the given tenant.
rpc Update(UpdateTenantRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateTenantRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/tenants/{tenant.id}"
body: "*"
};
}
// Delete the tenant with the given ID.
rpc Delete(DeleteTenantRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteTenantRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/tenants/{id}"
};
}
// Get the list of tenants.
rpc List(ListTenantsRequest) returns (ListTenantsResponse) {}
rpc List(ListTenantsRequest) returns (ListTenantsResponse) {
option(google.api.http) = {
get: "/api/tenants"
};
}
// Add an user to the tenant.
// Note: the user must already exist.
rpc AddUser(AddTenantUserRequest) returns (google.protobuf.Empty) {}
rpc AddUser(AddTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/tenants/{tenant_user.tenant_id}/users"
body: "*"
};
}
// Get the the tenant user for the given tenant and user IDs.
rpc GetUser(GetTenantUserRequest) returns (GetTenantUserResponse) {}
rpc GetUser(GetTenantUserRequest) returns (GetTenantUserResponse) {
option(google.api.http) = {
get: "/api/tenants/{tenant_id}/users/{user_id}"
};
}
// Update the given tenant user.
rpc UpdateUser(UpdateTenantUserRequest) returns (google.protobuf.Empty) {}
rpc UpdateUser(UpdateTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/tenants/{tenant_user.tenant_id}/users/{tenant_user.user_id}"
body: "*"
};
}
// Delete the given tenant user.
rpc DeleteUser(DeleteTenantUserRequest) returns (google.protobuf.Empty) {}
rpc DeleteUser(DeleteTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/tenants/{tenant_id}/users/{user_id}"
};
}
// Get the list of tenant users.
rpc ListUsers(ListTenantUsersRequest) returns (ListTenantUsersResponse) {}
rpc ListUsers(ListTenantUsersRequest) returns (ListTenantUsersResponse) {
option(google.api.http) = {
get: "/api/tenants/{tenant_id}/users"
};
}
}
message Tenant {

View File

@ -2,11 +2,12 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "UserProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
@ -14,22 +15,49 @@ import "google/protobuf/empty.proto";
// UserService is the service providing API methods for managing users.
service UserService {
// Create a new user.
rpc Create(CreateUserRequest) returns (CreateUserResponse) {}
rpc Create(CreateUserRequest) returns (CreateUserResponse) {
option(google.api.http) = {
post: "/api/users"
body: "*"
};
}
// Get the user for the given ID.
rpc Get(GetUserRequest) returns (GetUserResponse) {}
rpc Get(GetUserRequest) returns (GetUserResponse) {
option(google.api.http) = {
get: "/api/users/{id}"
};
}
// Update the given user.
rpc Update(UpdateUserRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/users/{user.id}"
body: "*"
};
}
// Delete the user with the given ID.
rpc Delete(DeleteUserRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/users/{id}"
};
}
// Get the list of users.
rpc List(ListUsersRequest) returns (ListUsersResponse) {}
rpc List(ListUsersRequest) returns (ListUsersResponse) {
option(google.api.http) = {
get: "/api/users"
};
}
// Update the password for the given user.
rpc UpdatePassword(UpdateUserPasswordRequest) returns (google.protobuf.Empty) {}
rpc UpdatePassword(UpdateUserPasswordRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/users/{user_id}/password"
body: "*"
};
}
}
message User {