podman

Форк
0
43 строки · 1.4 Кб
1
package docker
2

3
import (
4
	"context"
5
	"fmt"
6
	"net/http"
7
)
8

9
// UpdateContainerOptions specify parameters to the UpdateContainer function.
10
//
11
// See https://goo.gl/Y6fXUy for more details.
12
type UpdateContainerOptions struct {
13
	BlkioWeight        int           `json:"BlkioWeight"`
14
	CPUShares          int           `json:"CpuShares"`
15
	CPUPeriod          int           `json:"CpuPeriod"`
16
	CPURealtimePeriod  int64         `json:"CpuRealtimePeriod"`
17
	CPURealtimeRuntime int64         `json:"CpuRealtimeRuntime"`
18
	CPUQuota           int           `json:"CpuQuota"`
19
	CpusetCpus         string        `json:"CpusetCpus"`
20
	CpusetMems         string        `json:"CpusetMems"`
21
	Memory             int           `json:"Memory"`
22
	MemorySwap         int           `json:"MemorySwap"`
23
	MemoryReservation  int           `json:"MemoryReservation"`
24
	KernelMemory       int           `json:"KernelMemory"`
25
	RestartPolicy      RestartPolicy `json:"RestartPolicy,omitempty"`
26
	Context            context.Context
27
}
28

29
// UpdateContainer updates the container at ID with the options
30
//
31
// See https://goo.gl/Y6fXUy for more details.
32
func (c *Client) UpdateContainer(id string, opts UpdateContainerOptions) error {
33
	resp, err := c.do(http.MethodPost, fmt.Sprintf("/containers/"+id+"/update"), doOptions{
34
		data:      opts,
35
		forceJSON: true,
36
		context:   opts.Context,
37
	})
38
	if err != nil {
39
		return err
40
	}
41
	defer resp.Body.Close()
42
	return nil
43
}
44

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.