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

Commit8ebcfd1

Browse files
authored
Merge pull request#188 from jmcampanini/jc/add-updateimage
add method to patch an image
2 parentsce06c53 +b7fbf9c commit8ebcfd1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎coder-sdk/image.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ 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+
DefaultTag*string`json:"default_tag"`
56+
}
57+
4758
// ImportImage creates a new image and optionally a new registry.
4859
func (cClient)ImportImage(ctx context.Context,orgIDstring,reqImportImageReq) (*Image,error) {
4960
varimgImage
@@ -61,3 +72,8 @@ func (c Client) OrganizationImages(ctx context.Context, orgID string) ([]Image,
6172
}
6273
returnimgs,nil
6374
}
75+
76+
// UpdateImage applies a partial update to an image resource.
77+
func (cClient)UpdateImage(ctx context.Context,imageIDstring,reqUpdateImageReq)error {
78+
returnc.requestBody(ctx,http.MethodPatch,"/api/images/"+imageID,req,nil)
79+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp