nox icon indicating copy to clipboard operation
nox copied to clipboard

Rework builtin api for services

Open coder11 opened this issue 4 years ago • 0 comments

I think the api should better have the following interface (debatable):

alias ServiceId: string

data ServiceInfo:
    id: ServiceId
    blueprint_id: string
    owner_id: string
    interface: Interface

service Srv("srv"):
    -- ...
    -- Returns a list of services running on a peer
    list() -> []ServiceId

    -- Retrieves the functional interface of a service running
    -- on the node specified in the service call
    -- Argument: service_id – ID of the service whose interface you want to retrieve.
    get_interface(service_id: string) -> ServiceInfo

Basically, moving all the data into 'details' api and leaving list with only ids

coder11 avatar Jun 18 '21 17:06 coder11