Files
cli/components/engine/vendor/src/github.com/Microsoft/hcsshim/getcomputesystemproperties.go
T
Stefan J. Wernli 452a7d0ba9 Adding servicing update to postRunProcessing for Windows containers.
This change enables the workflow of finishing installing Windows OS updates in the container after it has completed running, via a special servicing container.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: da92dad59f76421a22a955d2aed25bfeb4562385
Component: engine
2016-04-25 12:16:26 -07:00

44 lines
1.0 KiB
Go

package hcsshim
import (
"encoding/json"
"github.com/Sirupsen/logrus"
)
// ComputeSystemProperties is a struct describing the returned properties.
type ComputeSystemProperties struct {
ID string
Name string
Stopped bool
AreUpdatesPending bool
}
// GetComputeSystemProperties gets the properties for the compute system with the given ID.
func GetComputeSystemProperties(id string, flags uint32) (ComputeSystemProperties, error) {
title := "hcsshim::GetComputeSystemProperties "
csProps := ComputeSystemProperties{
Stopped: false,
AreUpdatesPending: false,
}
logrus.Debugf("Calling proc")
var buffer *uint16
err := getComputeSystemProperties(id, flags, &buffer)
if err != nil {
err = makeError(err, title, "")
logrus.Error(err)
return csProps, err
}
propData := convertAndFreeCoTaskMemString(buffer)
logrus.Debugf(title+" - succeeded output=%s", propData)
if err = json.Unmarshal([]byte(propData), &csProps); err != nil {
logrus.Error(err)
return csProps, err
}
return csProps, nil
}