namespace

package
v0.0.0-...-d5d7872 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UndefinedSizingHint = SizingHint{""}
	TinySizingHint      = SizingHint{"TINY"}
	SmallSizingHint     = SizingHint{"SMALL"}
	MediumSizingHint    = SizingHint{"MEDIUM"}
	LargeSizingHint     = SizingHint{"LARGE"}
)
View Source
var (
	UndefinedIpAssignmentMode   = IpAssignmentMode{""}
	DhcpIpAssignmentMode        = IpAssignmentMode{"DHCP"}
	StaticRangeIpAssignmentMode = IpAssignmentMode{"STATICRANGE"}
)
View Source
var (
	UndefinedNetworkProvider           = NetworkProvider{""}
	NsxtContainerPluginNetworkProvider = NetworkProvider{"NSXT_CONTAINER_PLUGIN"}
	// Since 7.0u1:-
	VSphereNetworkProvider = NetworkProvider{"VSPHERE_NETWORK"}
)
View Source
var (
	UndefinedLoadBalancerProvider = LoadBalancerProvider{""}
	HAProxyLoadBalancerProvider   = LoadBalancerProvider{"HA_PROXY"}
	AviLoadBalancerProvider       = LoadBalancerProvider{"AVI"}
)
View Source
var (
	UndefinedKubernetesStatus = KubernetesStatus{""}
	ReadyKubernetesStatus     = KubernetesStatus{"READY"}
	WarningKubernetesStatus   = KubernetesStatus{"WARNING"}
	ErrorKubernetesStatus     = KubernetesStatus{"ERROR"}
)
View Source
var (
	UndefinedConfigStatus   = ConfigStatus{""}
	ConfiguringConfigStatus = ConfigStatus{"CONFIGURING"}
	RemovingConfigStatus    = ConfigStatus{"REMOVING"}
	RunningConfigStatus     = ConfigStatus{"RUNNING"}
	ErrorConfigStatus       = ConfigStatus{"ERROR"}
)

Functions

This section is empty.

Types

type AddressRange

type AddressRange struct {
	SubnetMask      string `json:"subnet_mask,omitempty"`
	StartingAddress string `json:"starting_address"`
	Gateway         string `json:"gateway"`
	AddressCount    int    `json:"address_count,omitempty"`
}

Since 7.0.0:-

type AviConfigCreateSpec

type AviConfigCreateSpec struct {
	CertificateAuthorityChain string               `json:"certificate_authority_chain"`
	Password                  string               `json:"password"`
	Server                    *LoadBalancersServer `json:"server"`
	Username                  string               `json:"username"`
}

AviConfigCreateSpec defines full information for the linking of a Tanzu Kubernetes Grid enabled vSphere cluster to an NSX Advanced Load Balancer (formerly Avi Load Balancer) See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/LoadBalancers/AviConfigCreateSpec/ Since 7.0u2:-

type Cidr

type Cidr struct {
	Address string `json:"address"`
	Prefix  int    `json:"prefix"`
}

Cidr defines an IPv4 CIDR range for a subnet. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/Namespaces/Instances/Ipv4Cidr/ TODO decide whether to rename this in the Go API to match the vSphere API. Since 7.0.0:-

type ClusterSummary

type ClusterSummary struct {
	ID   string `json:"cluster"`
	Name string `json:"cluster_name"`
	// Was string until #2860:-
	KubernetesStatus *KubernetesStatus `json:"kubernetes_status"`
	// Was string until #2860:-
	ConfigStatus *ConfigStatus `json:"config_status"`
}

ClusterSummary for a cluster with vSphere Namespaces enabled. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/Summary/ TODO plural vs singular - consistency with REST API above vs Go Since 7.0.0:-

func (*ClusterSummary) Reference

TODO whether to replace the below with a Go GUID (json to string) reference type? (I.e. replace ClusterSummary.ID string with ID ManagedObjectID) Reference implements the mo.Reference interface

type ConfigStatus

type ConfigStatus struct {
	// contains filtered or unexported fields
}

func ConfigStatusFromString

func ConfigStatusFromString(s string) ConfigStatus

func (*ConfigStatus) FromString

func (v *ConfigStatus) FromString(s string)

func (ConfigStatus) MarshalJSON

func (v ConfigStatus) MarshalJSON() ([]byte, error)

func (ConfigStatus) String

func (v ConfigStatus) String() string

func (*ConfigStatus) UnmarshalJSON

func (v *ConfigStatus) UnmarshalJSON(b []byte) error

type DefaultImageRegistry

type DefaultImageRegistry struct {
	Hostname string `json:"hostname"`
	Port     int    `json:"port,omitempty"`
}

Since 7.0.0:-

type DistributedSwitchCompatibilitySummary

type DistributedSwitchCompatibilitySummary struct {
	Compatible        bool   `json:"compatible"`
	DistributedSwitch string `json:"distributed_switch"`
}

Since 7.0.0:-

type EdgeClusterCompatibilitySummary

type EdgeClusterCompatibilitySummary struct {
	Compatible  bool   `json:"compatible"`
	EdgeCluster string `json:"edge_cluster"`
	DisplayName string `json:"display_name"`
}

Since 7.0.0:-

type EnableClusterSpec

type EnableClusterSpec struct {
	MasterDNSSearchDomains []string               `json:"master_DNS_search_domains,omitempty"`
	ImageStorage           ImageStorageSpec       `json:"image_storage"`
	NcpClusterNetworkSpec  *NcpClusterNetworkSpec `json:"ncp_cluster_network_spec,omitempty"`
	// Note: NcpClusterNetworkSpec is replaced by WorkloadNetworksSpec in vSphere 7.0u2+
	// Since 7.0u1:-
	WorkloadNetworksSpec    *WorkloadNetworksEnableSpec `json:"workload_networks_spec,omitempty"`
	MasterManagementNetwork *MasterManagementNetwork    `json:"master_management_network"`
	MasterDNSNames          []string                    `json:"Master_DNS_names,omitempty"`
	MasterNTPServers        []string                    `json:"master_NTP_servers,omitempty"`
	EphemeralStoragePolicy  string                      `json:"ephemeral_storage_policy,omitempty"`
	DefaultImageRepository  string                      `json:"default_image_repository,omitempty"`
	ServiceCidr             *Cidr                       `json:"service_cidr"`
	LoginBanner             string                      `json:"login_banner,omitempty"`
	// Was string until #2860:-
	SizeHint             *SizingHint           `json:"size_hint"`
	WorkerDNS            []string              `json:"worker_DNS,omitempty"`
	DefaultImageRegistry *DefaultImageRegistry `json:"default_image_registry,omitempty"`
	MasterDNS            []string              `json:"master_DNS,omitempty"`
	// Was string until #2860:-
	NetworkProvider                        *NetworkProvider        `json:"network_provider"`
	MasterStoragePolicy                    string                  `json:"master_storage_policy,omitempty"`
	DefaultKubernetesServiceContentLibrary string                  `json:"default_kubernetes_service_content_library,omitempty"`
	WorkloadNTPServers                     []string                `json:"workload_ntp_servers,omitempty"`
	LoadBalancerConfigSpec                 *LoadBalancerConfigSpec `json:"load_balancer_config_spec,omitempty"`
}

EnableClusterSpec defines a Tanzu Supervisor Cluster for creation. See: https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/EnableSpec/ Since 7.0.0:-

type HAProxyConfigCreateSpec

type HAProxyConfigCreateSpec struct {
	CertificateAuthorityChain string                `json:"certificate_authority_chain"`
	Password                  string                `json:"password"`
	Servers                   []LoadBalancersServer `json:"servers"`
	Username                  string                `json:"username"`
}

HAProxyConfigCreateSpec defines full information for the linking of a Tanzu Kubernetes Grid enabled vSphere cluster to a HA Proxy Load Balancer. Note: HA Proxy is not supported in vSphere 7.0u3 and above. Use Avi

with vSphere networking, or NSX-T networking, instead.

See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/LoadBalancers/HAProxyConfigCreateSpec/ Since 7.0u1:-

type ImageStorageSpec

type ImageStorageSpec struct {
	StoragePolicy string `json:"storage_policy"`
}

ImageStorageSpec defines the storage policy ID (not name) assigned to a Tanzu Kubernetes Grid cluster (supervisor or workload clusters) See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/ImageStorageSpec/ Since 7.0.0:-

type IpAssignmentMode

type IpAssignmentMode struct {
	// contains filtered or unexported fields
}

IpAssignmentMode specifies whether DHCP or a static range assignment method is used. This is used for both Supervisor Cluster and Workload Cluster networks in 7.0u3 and above. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Networks/IPAssignmentMode/ TODO decide whether to rename this in the Go API to match the vSphere API. Since 7.0u3:-

func IpAssignmentModeFromString

func IpAssignmentModeFromString(s string) IpAssignmentMode

func (*IpAssignmentMode) FromString

func (v *IpAssignmentMode) FromString(s string)

func (IpAssignmentMode) MarshalJSON

func (v IpAssignmentMode) MarshalJSON() ([]byte, error)

func (IpAssignmentMode) String

func (v IpAssignmentMode) String() string

func (*IpAssignmentMode) UnmarshalJSON

func (v *IpAssignmentMode) UnmarshalJSON(b []byte) error

type IpRange

type IpRange struct {
	Address string `json:"address,omitempty"`
	Count   int    `json:"count,omitempty"`
}

IpRange specifies a contiguous set of IPv4 Addresses See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/IPRange/ TODO decide whether to rename this in the Go API to match the vSphere API. Note: omitempty allows AddressRanges: []IpRange to become json [] Since 7.0u1:-

type KubernetesStatus

type KubernetesStatus struct {
	// contains filtered or unexported fields
}

func KubernetesStatusFromString

func KubernetesStatusFromString(s string) KubernetesStatus

func (*KubernetesStatus) FromString

func (v *KubernetesStatus) FromString(s string)

func (KubernetesStatus) MarshalJSON

func (v KubernetesStatus) MarshalJSON() ([]byte, error)

func (KubernetesStatus) String

func (v KubernetesStatus) String() string

func (*KubernetesStatus) UnmarshalJSON

func (v *KubernetesStatus) UnmarshalJSON(b []byte) error

type LoadBalancerConfigSpec

type LoadBalancerConfigSpec struct {
	// AddressRanges removed since 7.0u2:- (Now in workload network spec)
	AddressRanges           []IpRange                `json:"address_ranges,omitempty"` // omitempty to prevent null being the value
	HAProxyConfigCreateSpec *HAProxyConfigCreateSpec `json:"ha_proxy_config_create_spec,omitempty"`
	// Optional for create:-
	Id       string                `json:"id"`
	Provider *LoadBalancerProvider `json:"provider"`
	// Since 7.0u2:-
	AviConfigCreateSpec *AviConfigCreateSpec `json:"avi_config_create_spec,omitempty"`
}

LoadBalancerConfigSpec defines LoadBalancer options for Tanzu Kubernetes Grid, both for the Supervisor Cluster and for Workload Cluster kubeapi endpoints, and services of type LoadBalancer See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/LoadBalancers/ConfigSpec/ Since 7.0u1:-

type LoadBalancerProvider

type LoadBalancerProvider struct {
	// contains filtered or unexported fields
}

A LoadBalancerProvider is an enum type that defines the Load Balancer technology in use in a Tanzu Kubernetes Grid cluster. Note: If invalid or undefined (E.g. if a newer/older vSphere

version is used whose option isn't listed) then the
UndefinedLoadBalancerProvider value shall be set.
This translates to an empty string, removing its element
from the produces JSON.

See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/LoadBalancers/Provider/

func LoadBalancerFromString

func LoadBalancerFromString(s string) LoadBalancerProvider

func (*LoadBalancerProvider) FromString

func (v *LoadBalancerProvider) FromString(s string)

func (LoadBalancerProvider) MarshalJSON

func (v LoadBalancerProvider) MarshalJSON() ([]byte, error)

func (LoadBalancerProvider) String

func (v LoadBalancerProvider) String() string

func (*LoadBalancerProvider) UnmarshalJSON

func (v *LoadBalancerProvider) UnmarshalJSON(b []byte) error

type LoadBalancersServer

type LoadBalancersServer struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

LoadBalancersServer defines an Avi or HA Proxy load balancer location. Host can be an IP Address (normally an Avi Management Virtual IP for the Avi Controller(s)) or a hostname. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/LoadBalancers/Server/ Since 7.0u1:-

type Manager

type Manager struct {
	*rest.Client
}

Manager extends rest.Client, adding namespace related methods.

func NewManager

func NewManager(client *rest.Client) *Manager

NewManager creates a new Manager instance with the given client.

func (*Manager) ActivateSupervisorServices

func (c *Manager) ActivateSupervisorServices(ctx context.Context, id string) error

ActivateSupervisorServices activates a previously registered Supervisor Service.

func (*Manager) CreateSupervisorService

func (c *Manager) CreateSupervisorService(ctx context.Context, service *SupervisorService) error

CreateSupervisorService creates a new Supervisor Service on vSphere Namespaces endpoint.

func (*Manager) CreateSupportBundle

func (c *Manager) CreateSupportBundle(ctx context.Context, id string) (*SupportBundleLocation, error)

CreateSupportBundle retrieves the cluster's Namespaces-related support bundle.

func (*Manager) DeactivateSupervisorServices

func (c *Manager) DeactivateSupervisorServices(ctx context.Context, id string) error

DeactivateSupervisorServices deactivates a previously registered Supervisor Service.

func (*Manager) DisableCluster

func (c *Manager) DisableCluster(ctx context.Context, id string) error

EnableCluster enables vSphere Namespaces on the specified cluster, using the given spec.

func (*Manager) EnableCluster

func (c *Manager) EnableCluster(ctx context.Context, id string, spec *EnableClusterSpec) error

EnableCluster enables vSphere Namespaces on the specified cluster, using the given spec. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/api/vcenter/namespace-management/clusters/clusteractionenable/post/

func (*Manager) GetSupervisorService

func (c *Manager) GetSupervisorService(ctx context.Context, id string) (SupervisorServiceInfo, error)

GetSupervisorService gets the information of a specific supervisor service.

func (*Manager) ListClusters

func (c *Manager) ListClusters(ctx context.Context) ([]ClusterSummary, error)

ListClusters returns a summary of all clusters with vSphere Namespaces enabled.

func (*Manager) ListCompatibleDistributedSwitches

func (c *Manager) ListCompatibleDistributedSwitches(ctx context.Context, clusterId string) (result []DistributedSwitchCompatibilitySummary, err error)

func (*Manager) ListCompatibleEdgeClusters

func (c *Manager) ListCompatibleEdgeClusters(ctx context.Context, clusterId string, switchId string) (result []EdgeClusterCompatibilitySummary, err error)

func (*Manager) ListSupervisorServices

func (c *Manager) ListSupervisorServices(ctx context.Context) ([]SupervisorServiceSummary, error)

ListSupervisorServices returns a summary of all clusters with vSphere Namespaces enabled.

func (*Manager) RemoveSupervisorService

func (c *Manager) RemoveSupervisorService(ctx context.Context, id string) error

RemoveSupervisorService removes a previously deactivated supervisor service.

func (*Manager) SupportBundleRequest

func (c *Manager) SupportBundleRequest(ctx context.Context, bundle *SupportBundleLocation) (*http.Request, error)

SupportBundleRequest returns an http.Request which can be used to download the given support bundle.

type MasterManagementNetwork

type MasterManagementNetwork struct {
	Mode         *IpAssignmentMode `json:"mode"`
	FloatingIP   string            `json:"floating_IP,omitempty"`
	AddressRange *AddressRange     `json:"address_range,omitempty"`
	Network      string            `json:"network"`
}

Since 7.0.0:-

type NcpClusterNetworkSpec

type NcpClusterNetworkSpec struct {
	NsxEdgeCluster           string `json:"nsx_edge_cluster,omitempty"`
	PodCidrs                 []Cidr `json:"pod_cidrs"`
	EgressCidrs              []Cidr `json:"egress_cidrs"`
	ClusterDistributedSwitch string `json:"cluster_distributed_switch,omitempty"`
	IngressCidrs             []Cidr `json:"ingress_cidrs"`
}

NcpClusterNetworkSpec defines an NSX-T network for a Tanzu Kubernetes Grid workload cluster in vSphere 7.0.0 until 7.0u1. Note: NcpClusterNetworkSpec is replaced by WorkloadNetworksSpec in 7.0u2+. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/NCPClusterNetworkEnableSpec/ TODO decide whether to rename this in the Go API to match the vSphere API. Since 7.0.0:-

type NetworkProvider

type NetworkProvider struct {
	// contains filtered or unexported fields
}

NetworkProvider defines which type of See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/NetworkProvider/ Since 7.0.0:-

func ClusterNetworkProviderFromString

func ClusterNetworkProviderFromString(s string) NetworkProvider

func (*NetworkProvider) FromString

func (v *NetworkProvider) FromString(s string)

func (NetworkProvider) MarshalJSON

func (v NetworkProvider) MarshalJSON() ([]byte, error)

func (NetworkProvider) String

func (v NetworkProvider) String() string

func (*NetworkProvider) UnmarshalJSON

func (v *NetworkProvider) UnmarshalJSON(b []byte) error

type NetworksCreateSpec

type NetworksCreateSpec struct {
	Network         string                        `json:"network"`
	NetworkProvider *NetworkProvider              `json:"network_provider"`
	VSphereNetwork  *VsphereDVPGNetworkCreateSpec `json:"vsphere_network,omitempty"`
	// Since 7.0u3:-
	NsxNetwork *NsxNetwork `json:"nsx_network,omitempty"`
}

NetworksCreateSpec specifies a Tanzu Kubernetes Grid Supervisor or Workload network that should be created. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Networks/CreateSpec/ Since 7.0u1:-

type NsxNetwork

type NsxNetwork struct {
	EgressCidrs           []Cidr `json:"egress_cidrs"`
	IngressCidrs          []Cidr `json:"ingress_cidrs"`
	LoadBalancerSize      string `json:"load_balancer_size"`
	NamespaceNetworkCidrs []Cidr `json:"namespace_network_cidrs"`
	NsxTier0Gateway       string `json:"nsx_tier0_gateway"`
	RoutedMode            bool   `json:"routed_mode"`
	SubnetPrefixLength    int    `json:"subnet_prefix_length"`
}

NsxNetwork defines a supervisor or workload NSX-T network for use with a Tanzu Kubernetes Cluster. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Networks/NsxNetworkCreateSpec/ TODO decide whether to rename this in the Go API to match the vSphere API. Since 7.0u3:-

type SizingHint

type SizingHint struct {
	// contains filtered or unexported fields
}

SizingHint determines the size of the Tanzu Kubernetes Grid Supervisor cluster's kubeapi instances. Note: Only use TinySizingHint in non-production environments. Note: This is a secure coding pattern to avoid Stringly typed fields. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/SizingHint/ Since 7.0.0

func SizingHintFromString

func SizingHintFromString(s string) SizingHint

func (*SizingHint) FromString

func (v *SizingHint) FromString(s string)

func (SizingHint) MarshalJSON

func (v SizingHint) MarshalJSON() ([]byte, error)

func (SizingHint) String

func (v SizingHint) String() string

func (*SizingHint) UnmarshalJSON

func (v *SizingHint) UnmarshalJSON(b []byte) error

type SupervisorService

type SupervisorService struct {
	VsphereService SupervisorServicesVSphereSpec `json:"vsphere_spec,omitempty"`
}

SupervisorService defines a new SupervisorService specification

type SupervisorServiceInfo

type SupervisorServiceInfo struct {
	Name        string `json:"display_name"`
	State       string `json:"state"`
	Description string `json:"description"`
}

SupervisorServiceInfo for a supervisor service existent in vSphere.

type SupervisorServiceSummary

type SupervisorServiceSummary struct {
	ID    string `json:"supervisor_service"`
	Name  string `json:"display_name"`
	State string `json:"state"`
}

SupervisorServiceSummary for a supervisor service existent in vSphere.

type SupervisorServicesVSphereSpec

type SupervisorServicesVSphereSpec struct {
	VersionSpec SupervisorServicesVSphereVersionCreateSpec `json:"version_spec"`
}

SupervisorServicesVSphereSpec defines a new SupervisorService specification of vSphere type

type SupervisorServicesVSphereVersionCreateSpec

type SupervisorServicesVSphereVersionCreateSpec struct {
	Content         string `json:"content"`
	TrustedProvider bool   `json:"trusted_provider,omitempty"`
	AcceptEula      bool   `json:"accept_EULA,omitempty"`
}

SupervisorServicesVSphereVersionCreateSpec defines a new SupervisorService specification for vSphere

type SupportBundleLocation

type SupportBundleLocation struct {
	Token SupportBundleToken `json:"wcp_support_bundle_token"`
	URL   string             `json:"url"`
}

SupportBundleLocation contains the URL to download the per-cluster support bundle from, as well as a token required. Since 7.0.0:-

type SupportBundleToken

type SupportBundleToken struct {
	Expiry string `json:"expiry"`
	Token  string `json:"token"`
}

SupportBundleToken information about the token required in the HTTP GET request to generate the support bundle. Since 7.0.0:-

type VsphereDVPGNetworkCreateSpec

type VsphereDVPGNetworkCreateSpec struct {
	AddressRanges []IpRange `json:"address_ranges"`
	Gateway       string    `json:"gateway"`
	PortGroup     string    `json:"portgroup"`
	SubnetMask    string    `json:"subnet_mask"`
	// Since 7.0u3:-
	IpAssignmentMode *IpAssignmentMode `json:"ip_assignment_mode,omitempty"`
}

See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Networks/VsphereDVPGNetworkCreateSpec/ Since 7.0u1:-

type WorkloadNetworksEnableSpec

type WorkloadNetworksEnableSpec struct {
	SupervisorPrimaryWorkloadNetwork *NetworksCreateSpec `json:"supervisor_primary_workload_network"`
}

WorkloadNetworksEnableSpec defines the primary workload network for a new Tanzu Kubernetes Grid supervisor cluster. This may be used by namespaces for workloads too. See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/NamespaceManagement/Clusters/WorkloadNetworksEnableSpec/ TODO decide whether to rename this in the Go API to match the vSphere API. Since 7.0u1:-

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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