Skip to content

Commit e7da75d

Browse files
Update Cloud Agent Private Link API (#772)
1 parent bb3bef4 commit e7da75d

4 files changed

Lines changed: 119 additions & 125 deletions

File tree

cmd/lk/agent_private_link.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ var privateLinkCommands = &cli.Command{
1616
Usage: "Manage private links for agents",
1717
Commands: []*cli.Command{
1818
{
19-
Name: "create",
20-
Usage: "Create a private link",
19+
Name: "create",
20+
Usage: "Create a private link",
2121
Description: "Creates a private link to a customer endpoint.\n\n" +
2222
"Currently expects an AWS VPC Endpoint Service Name for --endpoint.\n" +
2323
"Example: com.amazonaws.vpce.us-east-1.vpce-svc-123123a1c43abc123",
@@ -104,14 +104,14 @@ func privateLinkServiceDNS(name, projectID string) string {
104104
return fmt.Sprintf("%s-%s.plg.svc", name, projectID)
105105
}
106106

107-
func buildPrivateLinkListRows(links []*lkproto.PrivateLink, healthByID map[string]*lkproto.PrivateLinkHealthStatus, healthErrByID map[string]error) [][]string {
107+
func buildPrivateLinkListRows(links []*lkproto.PrivateLink, healthByID map[string]*lkproto.PrivateLinkStatus, healthErrByID map[string]error) [][]string {
108108
var rows [][]string
109109
for _, link := range links {
110110
if link == nil {
111111
continue
112112
}
113113

114-
status := lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_UNKNOWN.String()
114+
status := lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN.String()
115115
updatedAt := "-"
116116

117117
if err, ok := healthErrByID[link.PrivateLinkId]; ok && err != nil {
@@ -173,13 +173,13 @@ func listPrivateLinks(ctx context.Context, cmd *cli.Command) error {
173173
return formatPrivateLinkClientError("list", err)
174174
}
175175

176-
healthByID := make(map[string]*lkproto.PrivateLinkHealthStatus, len(resp.Items))
176+
healthByID := make(map[string]*lkproto.PrivateLinkStatus, len(resp.Items))
177177
healthErrByID := make(map[string]error)
178178
for _, link := range resp.Items {
179179
if link == nil || link.PrivateLinkId == "" {
180180
continue
181181
}
182-
health, healthErr := agentsClient.GetPrivateLinkHealthStatus(ctx, &lkproto.GetPrivateLinkHealthStatusRequest{
182+
health, healthErr := agentsClient.GetPrivateLinkStatus(ctx, &lkproto.GetPrivateLinkStatusRequest{
183183
PrivateLinkId: link.PrivateLinkId,
184184
})
185185
if healthErr != nil {
@@ -193,9 +193,9 @@ func listPrivateLinks(ctx context.Context, cmd *cli.Command) error {
193193

194194
if cmd.Bool("json") {
195195
type privateLinkWithHealth struct {
196-
PrivateLink *lkproto.PrivateLink `json:"private_link"`
197-
Health *lkproto.PrivateLinkHealthStatus `json:"health"`
198-
HealthError string `json:"health_error,omitempty"`
196+
PrivateLink *lkproto.PrivateLink `json:"private_link"`
197+
Status *lkproto.PrivateLinkStatus `json:"health"`
198+
HealthError string `json:"health_error,omitempty"`
199199
}
200200
items := make([]privateLinkWithHealth, 0, len(resp.Items))
201201
for _, link := range resp.Items {
@@ -204,7 +204,7 @@ func listPrivateLinks(ctx context.Context, cmd *cli.Command) error {
204204
}
205205
entry := privateLinkWithHealth{
206206
PrivateLink: link,
207-
Health: healthByID[link.PrivateLinkId],
207+
Status: healthByID[link.PrivateLinkId],
208208
}
209209
if err := healthErrByID[link.PrivateLinkId]; err != nil {
210210
entry.HealthError = err.Error()
@@ -245,7 +245,7 @@ func deletePrivateLink(ctx context.Context, cmd *cli.Command) error {
245245

246246
func getPrivateLinkHealthStatus(ctx context.Context, cmd *cli.Command) error {
247247
privateLinkID := cmd.String("id")
248-
resp, err := agentsClient.GetPrivateLinkHealthStatus(ctx, &lkproto.GetPrivateLinkHealthStatusRequest{
248+
resp, err := agentsClient.GetPrivateLinkStatus(ctx, &lkproto.GetPrivateLinkStatusRequest{
249249
PrivateLinkId: privateLinkID,
250250
})
251251
if err != nil {

cmd/lk/agent_private_link_test.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"testing"
55
"time"
66

7+
lkproto "github.com/livekit/protocol/livekit"
78
"github.com/stretchr/testify/assert"
89
"github.com/stretchr/testify/require"
9-
lkproto "github.com/livekit/protocol/livekit"
1010
"github.com/urfave/cli/v3"
1111
"google.golang.org/protobuf/types/known/timestamppb"
1212
)
@@ -62,7 +62,7 @@ func TestPrivateLinkServiceDNS(t *testing.T) {
6262
}
6363

6464
func TestBuildPrivateLinkListRows_EmptyList(t *testing.T) {
65-
rows := buildPrivateLinkListRows([]*lkproto.PrivateLink{}, map[string]*lkproto.PrivateLinkHealthStatus{}, map[string]error{})
65+
rows := buildPrivateLinkListRows([]*lkproto.PrivateLink{}, map[string]*lkproto.PrivateLinkStatus{}, map[string]error{})
6666
assert.Empty(t, rows)
6767
}
6868

@@ -77,9 +77,9 @@ func TestBuildPrivateLinkListRows_OnePrivateLink(t *testing.T) {
7777
}
7878

7979
now := time.Now().UTC()
80-
healthByID := map[string]*lkproto.PrivateLinkHealthStatus{
80+
healthByID := map[string]*lkproto.PrivateLinkStatus{
8181
"pl-1": {
82-
Status: lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_HEALTHY,
82+
Status: lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE,
8383
UpdatedAt: timestamppb.New(now),
8484
},
8585
}
@@ -90,7 +90,7 @@ func TestBuildPrivateLinkListRows_OnePrivateLink(t *testing.T) {
9090
assert.Equal(t, "orders-db", rows[0][1])
9191
assert.Equal(t, "us-east-1", rows[0][2])
9292
assert.Equal(t, "6379", rows[0][3])
93-
assert.Equal(t, lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_HEALTHY.String(), rows[0][4])
93+
assert.Equal(t, lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE.String(), rows[0][4])
9494
}
9595

9696
func TestBuildPrivateLinkListRows_TwoPrivateLinksDifferentRegions(t *testing.T) {
@@ -109,12 +109,12 @@ func TestBuildPrivateLinkListRows_TwoPrivateLinksDifferentRegions(t *testing.T)
109109
},
110110
}
111111

112-
healthByID := map[string]*lkproto.PrivateLinkHealthStatus{
112+
healthByID := map[string]*lkproto.PrivateLinkStatus{
113113
"pl-1": {
114-
Status: lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_HEALTHY,
114+
Status: lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE,
115115
},
116116
"pl-2": {
117-
Status: lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_UNHEALTHY,
117+
Status: lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE,
118118
},
119119
}
120120

@@ -123,8 +123,6 @@ func TestBuildPrivateLinkListRows_TwoPrivateLinksDifferentRegions(t *testing.T)
123123

124124
assert.Equal(t, "us-east-1", rows[0][2])
125125
assert.Equal(t, "eu-west-1", rows[1][2])
126-
assert.Equal(t, lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_HEALTHY.String(), rows[0][4])
127-
assert.Equal(t, lkproto.PrivateLinkHealthStatus_PRIVATE_LINK_ATTACHMENT_HEALTH_STATUS_UNHEALTHY.String(), rows[1][4])
126+
assert.Equal(t, lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE.String(), rows[0][4])
127+
assert.Equal(t, lkproto.PrivateLinkStatus_PRIVATE_LINK_STATUS_AVAILABLE.String(), rows[1][4])
128128
}
129-
130-

go.mod

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ require (
1212
github.com/go-logr/logr v1.4.3
1313
github.com/go-task/task/v3 v3.44.1
1414
github.com/joho/godotenv v1.5.1
15-
github.com/livekit/protocol v1.44.1-0.20260212060033-b3d04db215ef
16-
github.com/livekit/server-sdk-go/v2 v2.13.4-0.20260212013907-8b9f855080d8
15+
github.com/livekit/protocol v1.44.1-0.20260223200831-a71190b6850a
16+
github.com/livekit/server-sdk-go/v2 v2.13.4-0.20260223172816-77b4264bca63
1717
github.com/moby/patternmatcher v0.6.0
1818
github.com/pelletier/go-toml v1.9.5
1919
github.com/pion/rtcp v1.2.16
20-
github.com/pion/rtp v1.10.0
21-
github.com/pion/webrtc/v4 v4.2.3
20+
github.com/pion/rtp v1.10.1
21+
github.com/pion/webrtc/v4 v4.2.6
2222
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
2323
github.com/pkg/errors v0.9.1
2424
github.com/stretchr/testify v1.11.1
@@ -33,8 +33,8 @@ require (
3333
)
3434

3535
require (
36-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20251209175733-2a1774d88802.1 // indirect
37-
buf.build/go/protovalidate v1.1.0 // indirect
36+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1 // indirect
37+
buf.build/go/protovalidate v1.1.2 // indirect
3838
buf.build/go/protoyaml v0.6.0 // indirect
3939
cel.dev/expr v0.25.1 // indirect
4040
dario.cat/mergo v1.0.2 // indirect
@@ -84,7 +84,7 @@ require (
8484
github.com/felixge/httpsnoop v1.0.4 // indirect
8585
github.com/fsnotify/fsnotify v1.9.0 // indirect
8686
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
87-
github.com/gammazero/deque v1.2.0 // indirect
87+
github.com/gammazero/deque v1.2.1 // indirect
8888
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
8989
github.com/go-git/go-billy/v5 v5.6.2 // indirect
9090
github.com/go-git/go-git/v5 v5.16.2 // indirect
@@ -96,7 +96,7 @@ require (
9696
github.com/gogo/protobuf v1.3.2 // indirect
9797
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
9898
github.com/golang/protobuf v1.5.4 // indirect
99-
github.com/google/cel-go v0.26.1 // indirect
99+
github.com/google/cel-go v0.27.0 // indirect
100100
github.com/google/go-cmp v0.7.0 // indirect
101101
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
102102
github.com/google/uuid v1.6.0 // indirect
@@ -108,7 +108,7 @@ require (
108108
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
109109
github.com/jxskiss/base62 v1.1.0 // indirect
110110
github.com/kevinburke/ssh_config v1.2.0 // indirect
111-
github.com/klauspost/compress v1.18.3 // indirect
111+
github.com/klauspost/compress v1.18.4 // indirect
112112
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
113113
github.com/lithammer/shortuuid/v4 v4.2.0 // indirect
114114
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 // indirect
@@ -130,14 +130,14 @@ require (
130130
github.com/muesli/termenv v0.16.0 // indirect
131131
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
132132
github.com/nats-io/nats.go v1.48.0 // indirect
133-
github.com/nats-io/nkeys v0.4.12 // indirect
133+
github.com/nats-io/nkeys v0.4.15 // indirect
134134
github.com/nats-io/nuid v1.0.1 // indirect
135135
github.com/opencontainers/go-digest v1.0.0 // indirect
136136
github.com/opencontainers/image-spec v1.1.1 // indirect
137137
github.com/pion/datachannel v1.6.0 // indirect
138-
github.com/pion/dtls/v3 v3.0.10 // indirect
138+
github.com/pion/dtls/v3 v3.1.2 // indirect
139139
github.com/pion/ice/v4 v4.2.0 // indirect
140-
github.com/pion/interceptor v0.1.43 // indirect
140+
github.com/pion/interceptor v0.1.44 // indirect
141141
github.com/pion/logging v0.2.4 // indirect
142142
github.com/pion/mdns/v2 v2.1.0 // indirect
143143
github.com/pion/randutil v0.1.0 // indirect
@@ -153,7 +153,7 @@ require (
153153
github.com/prometheus/client_golang v1.23.2 // indirect
154154
github.com/prometheus/client_model v0.6.2 // indirect
155155
github.com/prometheus/common v0.66.1 // indirect
156-
github.com/prometheus/procfs v0.16.1 // indirect
156+
github.com/prometheus/procfs v0.19.2 // indirect
157157
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
158158
github.com/redis/go-redis/v9 v9.17.2 // indirect
159159
github.com/rivo/uniseg v0.4.7 // indirect
@@ -163,7 +163,6 @@ require (
163163
github.com/shibumi/go-pathspec v1.3.0 // indirect
164164
github.com/sirupsen/logrus v1.9.3 // indirect
165165
github.com/skeema/knownhosts v1.3.1 // indirect
166-
github.com/stoewer/go-strcase v1.3.1 // indirect
167166
github.com/stretchr/objx v0.5.2 // indirect
168167
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect
169168
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
@@ -173,31 +172,31 @@ require (
173172
github.com/x448/float16 v0.8.4 // indirect
174173
github.com/xanzy/ssh-agent v0.3.3 // indirect
175174
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
176-
github.com/zeebo/xxh3 v1.0.2 // indirect
175+
github.com/zeebo/xxh3 v1.1.0 // indirect
177176
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
178-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
177+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
179178
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 // indirect
180179
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
181-
go.opentelemetry.io/otel v1.39.0 // indirect
180+
go.opentelemetry.io/otel v1.40.0 // indirect
182181
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect
183-
go.opentelemetry.io/otel/metric v1.39.0 // indirect
182+
go.opentelemetry.io/otel/metric v1.40.0 // indirect
184183
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
185-
go.opentelemetry.io/otel/trace v1.39.0 // indirect
184+
go.opentelemetry.io/otel/trace v1.40.0 // indirect
186185
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
187186
go.uber.org/multierr v1.11.0 // indirect
188187
go.uber.org/zap v1.27.1 // indirect
189188
go.uber.org/zap/exp v0.3.0 // indirect
190189
go.yaml.in/yaml/v2 v2.4.2 // indirect
191-
golang.org/x/crypto v0.47.0 // indirect
192-
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
193-
golang.org/x/mod v0.32.0 // indirect
194-
golang.org/x/net v0.49.0 // indirect
195-
golang.org/x/sys v0.40.0 // indirect
196-
golang.org/x/term v0.39.0 // indirect
197-
golang.org/x/text v0.33.0 // indirect
198-
google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect
199-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect
200-
google.golang.org/grpc v1.78.0 // indirect
190+
golang.org/x/crypto v0.48.0 // indirect
191+
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
192+
golang.org/x/mod v0.33.0 // indirect
193+
golang.org/x/net v0.50.0 // indirect
194+
golang.org/x/sys v0.41.0 // indirect
195+
golang.org/x/term v0.40.0 // indirect
196+
golang.org/x/text v0.34.0 // indirect
197+
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
198+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
199+
google.golang.org/grpc v1.79.1 // indirect
201200
gopkg.in/inf.v0 v0.9.1 // indirect
202201
gopkg.in/warnings.v0 v0.1.2 // indirect
203202
mvdan.cc/sh/v3 v3.12.0 // indirect

0 commit comments

Comments
 (0)