Skip to content

Commit

Permalink
[feat] - ei-3422 - Add the IOTICS circle services
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanieBracaloni committed Oct 28, 2024
1 parent 20cb649 commit 493376f
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 1 deletion.
120 changes: 120 additions & 0 deletions proto/iotics/api/circle.proto
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion proto/iotics/api/twin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit 493376f

Please sign in to comment.