Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitba5d4b8

Browse files
committed
Add ws dials for resource load and ide status
1 parent90dfe59 commitba5d4b8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎coder-sdk/env.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ type CreateEnvironmentRequest struct {
7878

7979
// CreateEnvironment sends a request to create an environment.
8080
func (cClient)CreateEnvironment(ctx context.Context,orgIDstring,reqCreateEnvironmentRequest) (*Environment,error) {
81-
varenv*Environment
81+
varenvEnvironment
8282
err:=c.requestBody(
8383
ctx,
8484
http.MethodPost,"/api/orgs/"+orgID+"/environments",
8585
req,
86-
env,
86+
&env,
8787
)
88-
returnenv,err
88+
return&env,err
8989
}
9090

9191
// EnvironmentsByOrganization gets the list of environments owned by the given user.
@@ -116,6 +116,11 @@ func (c Client) DialWsep(ctx context.Context, env *Environment) (*websocket.Conn
116116
returnc.dialWs(ctx,"/proxy/environments/"+env.ID+"/wsep")
117117
}
118118

119+
// DialIDEStatus opens a websocket connection for cpu load metrics on the environment
120+
func (cClient)DialIDEStatus(ctx context.Context,envIDstring) (*websocket.Conn,error) {
121+
returnc.dialWs(ctx,"/proxy/environments/"+envID+"/ide/api/status")
122+
}
123+
119124
// DialEnvironmentBuildLog opens a websocket connection for the environment build log messages
120125
func (cClient)DialEnvironmentBuildLog(ctx context.Context,envIDstring) (*websocket.Conn,error) {
121126
returnc.dialWs(ctx,"/api/environments/"+envID+"/watch-update")
@@ -125,3 +130,8 @@ func (c Client) DialEnvironmentBuildLog(ctx context.Context, envID string) (*web
125130
func (cClient)DialEnvironmentStats(ctx context.Context,envIDstring) (*websocket.Conn,error) {
126131
returnc.dialWs(ctx,"/api/environments/"+envID+"/watch-stats")
127132
}
133+
134+
// DialResourceLoad opens a websocket connection for cpu load metrics on the environment
135+
func (cClient)DialResourceLoad(ctx context.Context,envIDstring) (*websocket.Conn,error) {
136+
returnc.dialWs(ctx,"/api/environments/"+envID+"/watch-resource-load")
137+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp