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

Commit6236498

Browse files
committed
add sdk method to patch an image
1 parentce06c53 commit6236498

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎coder-sdk/image.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ type ImportImageReq struct {
4444
URLstring`json:"url"`
4545
}
4646

47+
// UpdateImageReq defines the requests parameters for a partial update of an image resource.
48+
typeUpdateImageReqstruct {
49+
DefaultCPUCores*float32`json:"default_cpu_cores"`
50+
DefaultMemoryGB*int`json:"default_memory_gb"`
51+
DefaultDiskGB*int`json:"default_disk_gb"`
52+
Description*string`json:"description"`
53+
URL*string`json:"url"`
54+
Deprecated*bool`json:"deprecated"`
55+
}
56+
4757
// ImportImage creates a new image and optionally a new registry.
4858
func (cClient)ImportImage(ctx context.Context,orgIDstring,reqImportImageReq) (*Image,error) {
4959
varimgImage
@@ -61,3 +71,8 @@ func (c Client) OrganizationImages(ctx context.Context, orgID string) ([]Image,
6171
}
6272
returnimgs,nil
6373
}
74+
75+
// UpdateImage applies a partial update to an image resource.
76+
func (cClient)UpdateImage(ctx context.Context,imageIDstring,reqUpdateImageReq)error {
77+
returnc.requestBody(ctx,http.MethodPatch,"/api/images/"+imageID,req,nil)
78+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp