From 493376fb7c5a1ccb931c3570682e65d8875e4cbd Mon Sep 17 00:00:00 2001 From: Stephanie Bracaloni Date: Tue, 22 Oct 2024 09:22:32 +0100 Subject: [PATCH] [feat] - ei-3422 - Add the IOTICS circle services --- proto/iotics/api/circle.proto | 120 ++++++++++++++++++++++++++++++++++ proto/iotics/api/twin.proto | 2 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 proto/iotics/api/circle.proto diff --git a/proto/iotics/api/circle.proto b/proto/iotics/api/circle.proto new file mode 100644 index 0000000..f21b85f --- /dev/null +++ b/proto/iotics/api/circle.proto @@ -0,0 +1,120 @@ +// Copyright (c) 2019-2024 Iotic Labs Ltd. All rights reserved. + +// Iotics Web protocol definitions (circles) +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; +import "iotics/api/common.proto"; +package iotics.api; + +option csharp_namespace = "Iotics.Api"; +option go_package = "github.com/Iotic-Labs/iotic-go-proto-qapi/iotics/api;ioticsapi"; +option java_multiple_files = true; +option java_outer_classname = "CircleProto"; +option java_package = "com.iotics.api"; +option objc_class_prefix = "IAX"; +option php_namespace = "Iotics\\Api"; + +// --------------------------------------------------------------------------------------------------------------------- + + +// CircleAPI enables creation and management of Iotics circles. +// Services only affect local resources. +service CircleAPI { + + // UpsertCircle creates or updates a circle with its metadata. + // The full state is applied (ie. if the operation succeeds the state of the circle will + // be the one described in the payload) + rpc UpsertCircle(UpsertCircleRequest) returns (UpsertCircleResponse) {} + + // DeleteCircle deletes a circle. + rpc DeleteCircle(DeleteCircleRequest) returns (DeleteCircleResponse) {} + + // Describes a circle. + rpc DescribeCircle(DescribeCircleRequest) returns (DescribeCircleResponse) {} + + // List all circles. + rpc ListAllCircles(ListAllCirclesRequest) returns (ListAllCirclesResponse) {} +} + +message CircleID { + // Circle Identifier (using DID format) + string id = 1; +} + + +message UpsertCircleRequest { + message Payload { + CircleID circleId = 1; + repeated Property properties = 2; + } + Headers headers = 1; + Payload payload = 2; +} + +message UpsertCircleResponse { + message Payload { + CircleID circleId = 1; + } + Headers headers = 1; + Payload payload = 2; +} + + +message DeleteCircleRequest { + message Arguments { + CircleID circleId = 1; + } + Headers headers = 1; + Arguments args = 2; +} + +message DeleteCircleResponse { + message Payload { + CircleID circleId = 1; + } + Headers headers = 1; + Payload payload = 2; +} + + +message DescribeCircleRequest { + message Arguments { + CircleID circleId = 1; + } + Headers headers = 1; + Arguments args = 3; +} + +message DescribeCircleResponse { + message MetaResult { + repeated Property properties = 1; + google.protobuf.Timestamp updatedAt = 2; + } + message Payload { + CircleID circleId = 1; + MetaResult result = 2; + } + Headers headers = 1; + Payload payload = 2; +} + + +message ListAllCirclesRequest { + Headers headers = 1; + Range range = 20; +} + +message ListAllCirclesResponse { + message CircleDetails { + CircleID circleId = 1; + repeated Property properties = 2; + google.protobuf.Timestamp updatedAt = 3; + } + + message Payload { + repeated CircleDetails circles = 1; + } + Headers headers = 1; + Payload payload = 2; +} \ No newline at end of file diff --git a/proto/iotics/api/twin.proto b/proto/iotics/api/twin.proto index 92f23c5..c06a4f1 100644 --- a/proto/iotics/api/twin.proto +++ b/proto/iotics/api/twin.proto @@ -30,7 +30,7 @@ service TwinAPI { // CreateTwin creates a twin. rpc CreateTwin(CreateTwinRequest) returns (CreateTwinResponse) {} - // UpsertTwin creates or update a twin with its metadata + the twin feeds and inputs with their metadata. + // UpsertTwin creates or updates a twin with its metadata + the twin feeds and inputs with their metadata. // The full state is applied (ie. if the operation succeeds the state of the twin, feeds and inputs will be the one // described in the payload) rpc UpsertTwin(UpsertTwinRequest) returns (UpsertTwinResponse) {}