common

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTIVE   = "ACTIVE"
	CREATING = "CREATING"
	UPDATING = "UPDATING"
	FAILED   = "FAILED"
	DELETED  = "DELETED"
	PURGING  = "PURGING"
)

Variables

View Source
var Wait = fmt.Errorf("waiting")

Functions

func GetClient

func GetClient(svcAcctKey map[string]string) *http.Client

func Poll

func Poll[T any](client *http.Client, req *http.Request, timeout time.Duration, predicate func(T) error) error

Poll repeatedly makes the http.Request on a http.Client until timeout or a result by the predicate other than Wait.

Types

type Credentials added in v0.20.0

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Error

type Error struct {
	Code    int              `json:"code"`
	Message string           `json:"message"`
	Status  string           `json:"status"`
	Details []map[string]any `json:"details"`
}

type HasError

type HasError interface {
	GetError() *Error
}

type Hcx

type Hcx struct {
	InternalIp string `json:"internalIp,omitempty"`
	// Deprecated
	ExternalIp string `json:"externalIp,omitempty"`
	Version    string `json:"version,omitempty"`
	State      State  `json:"state,omitempty"`
	Fqdn       string `json:"fqdn,omitempty"`
}

type List added in v0.20.0

type List[T any] struct {
	Items []T `json:"operations"`
}

type ListPrivateClouds added in v0.24.0

type ListPrivateClouds struct {
	PrivateClouds []PrivateCloud `json:"privateClouds,omitempty"`
	NextPageToken string         `json:"nextPageToken,omitempty"`
	Unreachable   []string       `json:"unreachable,omitempty"`
}

type ManagementCluster

type ManagementCluster struct {
	ClusterId           string `json:"clusterId"`
	NodeTypeId          string `json:"nodeTypeId"`
	NodeCount           int    `json:"nodeCount"`
	NodeCustomCoreCount int    `json:"nodeCustomCoreCount,omitempty"`
}

type NetworkConfig

type NetworkConfig struct {
	// Deprecated
	Network string `json:"network,omitempty"`
	// Deprecated
	ServiceNetwork      string `json:"serviceNetwork,omitempty"`
	ManagementCidr      string `json:"managementCidr"`
	VmwareEngineNetwork string `json:"vmwareEngineNetwork,omitempty"`
}

type Nsx

type Nsx struct {
	InternalIp string `json:"internalIp,omitempty"`
	// Deprecated
	ExternalIp string `json:"externalIp,omitempty"`
	Version    string `json:"version,omitempty"`
	State      State  `json:"state,omitempty"`
	Fqdn       string `json:"fqdn,omitempty"`
}

type Operation

type Operation struct {
	Name     string         `json:"name,omitempty"`
	Done     bool           `json:"done,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
	Response map[string]any `json:"response,omitempty"`
	Error    *Error         `json:"error,omitempty"`
}

func (*Operation) GetError

func (e *Operation) GetError() *Error

type PrivateCloud

type PrivateCloud struct {
	Name              string            `json:"name,omitempty"`
	CreateTime        *time.Time        `json:"createTime,omitempty"`
	UpdateTime        *time.Time        `json:"updateTime,omitempty"`
	DeleteTime        *time.Time        `json:"deleteTime,omitempty"`
	ExpireTime        *time.Time        `json:"expireTime,omitempty"`
	State             State             `json:"state,omitempty"`
	NetworkConfig     NetworkConfig     `json:"networkConfig"`
	ManagementCluster ManagementCluster `json:"managementCluster"`
	Description       string            `json:"description,omitempty"`
	Hcx               *Hcx              `json:"hcx,omitempty"`
	Nsx               *Nsx              `json:"nsx,omitempty"`
	Vcenter           *Vcenter          `json:"vcenter,omitempty"`
	UID               string            `json:"uid,omitempty"`
}

type RunResults added in v0.20.0

type RunResults struct {
	PrivateCloud       PrivateCloud `yaml:"privateCloud"`
	NsxCredentials     Credentials  `yaml:"nsxCredentials"`
	VcenterCredentials Credentials  `yaml:"vcenterCredentials"`
}

type State

type State string
const STATE_UNSPECIFIED State = "STATE_UNSPECIFIED"

type Vcenter

type Vcenter struct {
	InternalIp string `json:"internalIp,omitempty"`
	// Deprecated
	ExternalIp string `json:"externalIp,omitempty"`
	Version    string `json:"version,omitempty"`
	State      State  `json:"state,omitempty"`
	Fqdn       string `json:"fqdn,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL