syntax = "proto3";
package api;
option go_package = "github.com/brocaar/chirpstack-api/go/v3/as/external/api";
option java_package = "io.chirpstack.api.as.external.api";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "as/external/api/profiles.proto";
// DeviceProfileService is the service managing device-profiles.
service DeviceProfileService {
// Create creates the given device-profile.
rpc Create(CreateDeviceProfileRequest) returns (CreateDeviceProfileResponse) {
option(google.api.http) = {
post: "/api/device-profiles"
body: "*"
};
}
// Get returns the device-profile matching the given id.
rpc Get(GetDeviceProfileRequest) returns (GetDeviceProfileResponse) {
option(google.api.http) = {
get: "/api/device-profiles/{id}"
};
}
// Update updates the given device-profile.
rpc Update(UpdateDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/device-profiles/{device_profile.id}"
body: "*"
};
}
// Delete deletes the device-profile matching the given id.
rpc Delete(DeleteDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/device-profiles/{id}"
};
}
// List lists the available device-profiles.
rpc List(ListDeviceProfileRequest) returns (ListDeviceProfileResponse) {
option(google.api.http) = {
get: "/api/device-profiles"
};
}
}
message CreateDeviceProfileRequest {
// Device-profile object to create.
DeviceProfile device_profile = 1;
}
message CreateDeviceProfileResponse {
// Device-profile ID (UUID string).
string id = 1;
}
message GetDeviceProfileRequest {
// Device-profile ID (UUID string).
string id = 1;
}
message GetDeviceProfileResponse {
// Device-profile object.
DeviceProfile device_profile = 1;
// Created at timestamp.
google.protobuf.Timestamp created_at = 2;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
}
message UpdateDeviceProfileRequest {
// Device-profile object to update.
DeviceProfile device_profile = 1;
}
message DeleteDeviceProfileRequest {
// Device-profile ID (UUID string).
string id = 1;
}
message DeviceProfileListItem {
// Device-profile ID (UUID string).
string id = 1;
// Device-profile name.
string name = 2;
// Organization ID.
int64 organization_id = 3 [json_name = "organizationID"];
// Network-server ID.
int64 network_server_id = 4 [json_name = "networkServerID"];
// Created at timestamp.
google.protobuf.Timestamp created_at = 5;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 6;
// Network-server name.
string network_server_name = 7;
}
message ListDeviceProfileRequest {
// Max number of items to return.
int64 limit = 1;
// Offset in the result-set (for pagination).
int64 offset = 2;
// Organization id to filter on.
int64 organization_id = 3 [json_name = "organizationID"];
// Application id to filter on.
int64 application_id = 4 [json_name = "applicationID"];
}
message ListDeviceProfileResponse {
// Total number of device-profiles.
int64 total_count = 1;
repeated DeviceProfileListItem result = 2;
}