Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (66 sloc) 2.36 KB
syntax = "proto3";
import "protobuf/types/service.proto";
package api;
// This is the API to interact with the Services.
//
// This API is a [gRPC](https://grpc.io/) API.
//
// The source file of this API is hosted on [GitHub](https://github.com/mesg-foundation/engine/blob/master/protobuf/api/service.proto).
service Service {
// Create a Service from a Service Definition.
// It will return an unique identifier which is used to interact with the Service.
rpc Create (CreateServiceRequest) returns (CreateServiceResponse) {}
// Delete a Service.
// An error is returned if one or more Instances of the Service are running.
rpc Delete (DeleteServiceRequest) returns (DeleteServiceResponse) {}
// Get returns a Service matching the criteria of the request.
rpc Get(GetServiceRequest) returns (types.Service) {}
// List returns services specified in a request.
rpc List(ListServiceRequest) returns (ListServiceResponse) {}
}
// The request's data for the `Create` API.
message CreateServiceRequest {
// Service's sid.
string sid = 1;
// Service's name.
string name = 2;
// Service's description.
string description = 3;
// Configurations related to the service
types.Service.Configuration configuration = 4;
// The list of tasks this service can execute.
repeated types.Service.Task tasks = 5;
// The list of events this service can emit.
repeated types.Service.Event events = 6;
// The container dependencies this service requires.
repeated types.Service.Dependency dependencies = 7;
// Service's repository url.
string repository = 8;
// The hash id of service's source code on IPFS.
string source = 9;
}
// The response's data for the `Create` API.
message CreateServiceResponse {
// The service's hash created.
string hash = 1;
}
// The request's data for the `Delete` API.
message DeleteServiceRequest {
// The service's hash to delete.
string hash = 1;
}
// The response's data for the `Delete` API, doesn't contain anything.
message DeleteServiceResponse {
}
// The request's data for the `Get` API.
message GetServiceRequest {
// The service's hash to fetch.
string hash = 1;
}
// The request's data for the `List` API.
message ListServiceRequest {}
// The response's data for the `List` API.
message ListServiceResponse {
// List of services that match the request's filters.
repeated types.Service services = 1;
}
You can’t perform that action at this time.