mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-23 22:17:19 +00:00
runtime: Fix the format of the client code of cloud-hypervisor APIs
Regenerate the client code with the added `go-fmt` step. No functional
changes.
Fixes: #1606
Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 0c38d9ecc4
)
This commit is contained in:
parent
5a92333f4b
commit
e3efcfd40f
@ -157,7 +157,6 @@ func parameterToJson(obj interface{}) (string, error) {
|
||||
return string(jsonBuf), err
|
||||
}
|
||||
|
||||
|
||||
// callAPI do the request.
|
||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||
if c.cfg.Debug {
|
||||
|
@ -37,7 +37,6 @@ var (
|
||||
|
||||
// ContextAPIKey takes an APIKey as authentication for the request
|
||||
ContextAPIKey = contextKey("apikey")
|
||||
|
||||
)
|
||||
|
||||
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
||||
@ -52,7 +51,6 @@ type APIKey struct {
|
||||
Prefix string
|
||||
}
|
||||
|
||||
|
||||
// ServerVariable stores the information about a server variable
|
||||
type ServerVariable struct {
|
||||
Description string
|
||||
@ -104,7 +102,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
// ServerUrl returns URL based on server settings
|
||||
func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) {
|
||||
if index < 0 || len(c.Servers) <= index {
|
||||
return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1)
|
||||
return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers)-1)
|
||||
}
|
||||
server := c.Servers[index]
|
||||
url := server.Url
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// BalloonConfig struct for BalloonConfig
|
||||
type BalloonConfig struct {
|
||||
Size int64 `json:"size"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// CmdLineConfig struct for CmdLineConfig
|
||||
type CmdLineConfig struct {
|
||||
Args string `json:"args"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// ConsoleConfig struct for ConsoleConfig
|
||||
type ConsoleConfig struct {
|
||||
File string `json:"file,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// CpuTopology struct for CpuTopology
|
||||
type CpuTopology struct {
|
||||
ThreadsPerCore int32 `json:"threads_per_core,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// CpusConfig struct for CpusConfig
|
||||
type CpusConfig struct {
|
||||
BootVcpus int32 `json:"boot_vcpus"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// DeviceConfig struct for DeviceConfig
|
||||
type DeviceConfig struct {
|
||||
Path string `json:"path"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// DeviceNode struct for DeviceNode
|
||||
type DeviceNode struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// DiskConfig struct for DiskConfig
|
||||
type DiskConfig struct {
|
||||
Path string `json:"path"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// FsConfig struct for FsConfig
|
||||
type FsConfig struct {
|
||||
Tag string `json:"tag"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// InitramfsConfig struct for InitramfsConfig
|
||||
type InitramfsConfig struct {
|
||||
Path string `json:"path"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// KernelConfig struct for KernelConfig
|
||||
type KernelConfig struct {
|
||||
Path string `json:"path"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// MemoryConfig struct for MemoryConfig
|
||||
type MemoryConfig struct {
|
||||
Size int64 `json:"size"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// MemoryZoneConfig struct for MemoryZoneConfig
|
||||
type MemoryZoneConfig struct {
|
||||
Id string `json:"id"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// NetConfig struct for NetConfig
|
||||
type NetConfig struct {
|
||||
Tap string `json:"tap,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// NumaConfig struct for NumaConfig
|
||||
type NumaConfig struct {
|
||||
GuestNumaId int32 `json:"guest_numa_id"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// NumaDistance struct for NumaDistance
|
||||
type NumaDistance struct {
|
||||
Destination int32 `json:"destination"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// PciDeviceInfo Information about a PCI device
|
||||
type PciDeviceInfo struct {
|
||||
Id string `json:"id"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// PmemConfig struct for PmemConfig
|
||||
type PmemConfig struct {
|
||||
File string `json:"file"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// RateLimiterConfig Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
|
||||
type RateLimiterConfig struct {
|
||||
Bandwidth TokenBucket `json:"bandwidth,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// RestoreConfig struct for RestoreConfig
|
||||
type RestoreConfig struct {
|
||||
SourceUrl string `json:"source_url"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// RngConfig struct for RngConfig
|
||||
type RngConfig struct {
|
||||
Src string `json:"src"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// SgxEpcConfig struct for SgxEpcConfig
|
||||
type SgxEpcConfig struct {
|
||||
Size int64 `json:"size"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// TokenBucket Defines a token bucket with a maximum capacity (_size_), an initial burst size (_one_time_burst_) and an interval for refilling purposes (_refill_time_). The refill-rate is derived from _size_ and _refill_time_, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill-rate.
|
||||
type TokenBucket struct {
|
||||
// The total number of tokens this bucket can hold.
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmAddDevice struct for VmAddDevice
|
||||
type VmAddDevice struct {
|
||||
Path string `json:"path,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmConfig Virtual machine configuration
|
||||
type VmConfig struct {
|
||||
Cpus CpusConfig `json:"cpus,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmInfo Virtual Machine information
|
||||
type VmInfo struct {
|
||||
Config VmConfig `json:"config"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmRemoveDevice struct for VmRemoveDevice
|
||||
type VmRemoveDevice struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmResize struct for VmResize
|
||||
type VmResize struct {
|
||||
DesiredVcpus int32 `json:"desired_vcpus,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmResizeZone struct for VmResizeZone
|
||||
type VmResizeZone struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmSnapshotConfig struct for VmSnapshotConfig
|
||||
type VmSnapshotConfig struct {
|
||||
DestinationUrl string `json:"destination_url,omitempty"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VmmPingResponse Virtual Machine Monitor information
|
||||
type VmmPingResponse struct {
|
||||
Version string `json:"version"`
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
// VsockConfig struct for VsockConfig
|
||||
type VsockConfig struct {
|
||||
// Guest Vsock CID
|
||||
|
Loading…
Reference in New Issue
Block a user