Skip to content
This repository was archived by the owner on Jun 6, 2021. It is now read-only.
This repository was archived by the owner on Jun 6, 2021. It is now read-only.

API Role Skelton #12

Description

@Clivern
GET /agents
payload: N/A
response: {"agents":[{"ID": "" , "clientKey":"", "hostName":""}], "_metadata": {"totalCount": 10, "limit": 2, "offset": 0}}

POST /agents
payload: {"hostName":""}
response: HTTP 201 {"ID": "" , "clientKey":"", "hostName":""}

GET /agents/:id
payload:  HTTP 200 {"ID": "" , "clientKey":"", "hostName":""}

UPDATE /agents/:id
payload: {"hostName":""}
response: HTTP 200  {"ID": "" , "clientKey":"", "hostName":""}

DELETE /agents/:id
payload: N/A
response: HTTP 204 (No Content)
import (
   "context"
   "time"
   "github.com/silverbackhq/sloth/internal/app/module"
)


ctx, _ := context.WithTimeout(context.Background(), time.Duration(10) * time.Second)
etcd := module.NewEtcd()
err := etcd.Connect([]string{"127.0.0.1:2379"}, 3)

defer etcd.Disconnect()

etcd.Put(ctx, "agent", "sloth")
etcd.Get(ctx, "agent")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions