Documentation ¶
Index ¶
- Constants
- func CheckConfig(conf *ServiceConfig) error
- func CheckResponse(r *http.Response) error
- func FormatCredentials(a AuthCredentials) string
- type ActivePassiveConfig
- type AhvConfig
- type AuthCredentials
- type CalicoConfig
- type Client
- type ClusterAddRegistryRequest
- type ClusterAddRegistryResponse
- type ClusterCreateRequest
- type ClusterCreateResponse
- type ClusterDeleteRequest
- type ClusterDeleteResponse
- type ClusterGetHealthRequest
- type ClusterGetHealthResponse
- type ClusterGetKubeConfigRequest
- type ClusterGetKubeConfigResponse
- type ClusterGetNodePoolRequest
- type ClusterGetNodePoolResponse
- type ClusterGetRequest
- type ClusterGetResponse
- type ClusterGetSSHRequest
- type ClusterGetSSHResponse
- type ClusterGetTasksRequest
- type ClusterGetTasksResponse
- type ClusterListRegistriesRequest
- type ClusterListRegistriesResponse
- type ClusterListRequest
- type ClusterListResponse
- type ClusterRemoveRegistryRequest
- type ClusterRemoveRegistryResponse
- type ClusterService
- func (cs *ClusterService) Create(reqdata *ClusterCreateRequest) (*ClusterCreateResponse, *http.Response, error)
- func (cs *ClusterService) Delete(reqdata *ClusterDeleteRequest) (*ClusterDeleteResponse, *http.Response, error)
- func (cs *ClusterService) Get(reqdata *ClusterGetRequest) (*ClusterGetResponse, *http.Response, error)
- func (cs *ClusterService) GetHealth(reqdata *ClusterGetHealthRequest) (*ClusterGetHealthResponse, *http.Response, error)
- func (cs *ClusterService) GetKubeConfig(reqdata *ClusterGetKubeConfigRequest) (*ClusterGetKubeConfigResponse, *http.Response, error)
- func (cs *ClusterService) GetSSH(reqdata *ClusterGetSSHRequest) (*ClusterGetSSHResponse, *http.Response, error)
- func (cs *ClusterService) List(reqdata *ClusterListRequest) (*ClusterListResponse, *http.Response, error)
- func (cs *ClusterService) ListRegistries(reqdata *ClusterListRegistriesRequest) (*ClusterListRegistriesResponse, *http.Response, error)
- func (cs *ClusterService) UpdateSecret(reqdata *ClusterUpdateSecretRequest) (*ClusterUpdateSecretResponse, *http.Response, error)
- type ClusterUpdateSecretRequest
- type ClusterUpdateSecretResponse
- type CniConfig
- type CreateEtcdConfig
- type DeleteSkipCheck
- type EtcdConfig
- type ExternalLbConfig
- type FlannelConfig
- type IPPoolConfigs
- type MasterConfig
- type MasterNodesConfig
- type MastersConfig
- type MetaGetRequest
- type MetaGetResponse
- type MetaService
- type Metadata
- type NodePools
- type RegistryCreateRequest
- type RegistryCreateResponse
- type RegistryDeleteRequest
- type RegistryDeleteResponse
- type RegistryGetRequest
- type RegistryGetResponse
- type RegistryListRequest
- type RegistryListResponse
- type RegistryService
- func (rs *RegistryService) Create(reqdata *RegistryCreateRequest) (*RegistryCreateResponse, *http.Response, error)
- func (rs *RegistryService) Delete(reqdata *RegistryDeleteRequest) (*RegistryDeleteResponse, *http.Response, error)
- func (rs *RegistryService) Get(reqdata *RegistryGetRequest) (*RegistryGetResponse, *http.Response, error)
- func (rs *RegistryService) List(reqdata *RegistryGetRequest) (*RegistryGetResponse, *http.Response, error)
- type Service
- type ServiceConfig
- type SingleMasterConfig
- type StorageClassConfig
- type VolumesConfig
- type WorkerConfig
- type WorkersConfig
Constants ¶
const NUTANIX_KARBON_PASS = "NUTANIX_KARBON_PASS"
NUTANIX_KARBON_PASS is the environment variables for the KARBON password
const NUTANIX_KARBON_URL = "NUTANIX_KARBON_URL"
const NUTANIX_KARBON_USER = "NUTANIX_KARBON_USER"
NUTANIX_KARBON_USER is the environment variable name for the KARBON username
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
func CheckConfig(conf *ServiceConfig) error
CheckConfig will ensure that the minimal amount of information is present in the config
func CheckResponse ¶
CheckResponse looks for common response errors Need to fill this in at some point
func FormatCredentials ¶
func FormatCredentials(a AuthCredentials) string
FormatCredentials takes in an AuthCredential type and returns a base64 encoded string in the proper format for use by the REST API
Types ¶
type ActivePassiveConfig ¶
type ActivePassiveConfig struct {
ExternalIpv4Address string `json:"external_ipv4_address"`
}
type AuthCredentials ¶
AuthCredentials are the username and password received from ENV variables never hard code these values into any code!
func GetCredentials ¶
func GetCredentials(conf *ServiceConfig) (AuthCredentials, error)
GetCredentials gets the username and password from the ENV variables for use in the application
type CalicoConfig ¶
type CalicoConfig struct {
IPPoolConfigs []IPPoolConfigs `json:"ip_pool_configs"`
}
type Client ¶
type Client struct { KarbonURL *url.URL Login AuthCredentials Registry *RegistryService Cluster *ClusterService Meta *MetaService // contains filtered or unexported fields }
Client is an HTTP Client
func NewClient ¶
func NewClient(httpClient *http.Client, conf *ServiceConfig) (*Client, error)
NewClient is used for Nutanix Prism client instantiation
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.
type ClusterAddRegistryRequest ¶
type ClusterAddRegistryRequest struct{}
type ClusterAddRegistryResponse ¶
type ClusterAddRegistryResponse struct{}
type ClusterCreateRequest ¶
type ClusterCreateRequest struct { CniConfig CniConfig `json:"cni_config"` EtcdConfig CreateEtcdConfig `json:"etcd_config"` MastersConfig MastersConfig `json:"masters_config"` Metadata Metadata `json:"metadata"` Name string `json:"name"` StorageClassConfig StorageClassConfig `json:"storage_class_config"` Version string `json:"version"` WorkersConfig WorkersConfig `json:"workers_config"` }
ClusterCreateRequest Create a k8s cluster with the provided configuration.
type ClusterCreateResponse ¶
type ClusterCreateResponse struct { ClusterName string `json:"cluster_name"` ClusterUUID string `json:"cluster_uuid"` TaskUUID string `json:"task_uuid"` }
ClusterCreateResponse cluster create response of new cluster
type ClusterDeleteRequest ¶
type ClusterDeleteRequest struct { ClusterName string `json:"cluster_name"` SkipChecks bool `json:"skip_checks"` }
ClusterDeleteRequest deletes the identified cluster by name with or without skipping pre-checks
type ClusterDeleteResponse ¶
type ClusterDeleteResponse struct { ClusterName string `json:"cluster_name"` ClusterUUID string `json:"cluster_uuid"` TaskUUID string `json:"task_uuid"` }
ClusterDeleteResponse is the task and cluster information for the deleted resource
type ClusterGetHealthRequest ¶
type ClusterGetHealthRequest struct {
ClusterName string `json:"cluster_name"`
}
ClusterGetHealthRequest requests cluster health by cluster name for k8s
type ClusterGetHealthResponse ¶
type ClusterGetHealthResponse struct { Messages []string `json:"messages"` Status bool `json:"status"` }
ClusterGetHealthResponse provides the cluster health retrieved by cluster name
type ClusterGetKubeConfigRequest ¶
type ClusterGetKubeConfigRequest struct {
ClusterName string
}
ClusterGetKubeConfigRequest requests KubeConfig for CLUSTER_NAME
type ClusterGetKubeConfigResponse ¶
type ClusterGetKubeConfigResponse struct {
KubeConfig string `json:"kube_config"`
}
ClusterGetKubeConfigResponse returns the KubeConfig data to be used directly or placed in a file
type ClusterGetNodePoolRequest ¶
type ClusterGetNodePoolRequest struct{}
type ClusterGetNodePoolResponse ¶
type ClusterGetNodePoolResponse struct{}
type ClusterGetRequest ¶
type ClusterGetRequest struct {
ClusterName string `json:"cluster_name"`
}
ClusterGetRequest provides a cluster name to get details on the cluster
type ClusterGetResponse ¶
type ClusterGetResponse struct { EtcdConfig EtcdConfig `json:"etcd_config"` KubeapiServerIpv4Address string `json:"kubeapi_server_ipv4_address"` MasterConfig MasterConfig `json:"master_config"` Name string `json:"name"` Status string `json:"status"` UUID string `json:"uuid"` Version string `json:"version"` WorkerConfig WorkerConfig `json:"worker_config"` }
ClusterGetResponse returns details about a k8s cluster based on provided cluster name
type ClusterGetSSHRequest ¶
type ClusterGetSSHRequest struct {
ClusterName string `json:"cluster_name"`
}
ClusterGetSSHRequest Get SSH credentials to remotely access nodes belonging to the k8s cluster. The credentials have an expiry time of 24 hours.
type ClusterGetSSHResponse ¶
type ClusterGetSSHResponse struct { Certificate string `json:"certificate"` ExpiryTime string `json:"expiry_time"` PrivateKey string `json:"private_key"` Username string `json:"username"` }
ClusterGetSSHResponse SSH cluster credentials with 24 hour expiration time
type ClusterGetTasksRequest ¶
type ClusterGetTasksRequest struct{}
type ClusterGetTasksResponse ¶
type ClusterGetTasksResponse struct{}
type ClusterListRegistriesRequest ¶
type ClusterListRegistriesRequest struct {
ClusterName string `json:"cluster_name"`
}
ClusterListRegistriesRequest requests a list of registries by cluster name
type ClusterListRegistriesResponse ¶
type ClusterListRegistriesResponse []struct { Endpoint string `json:"endpoint"` Name string `json:"name"` UUID string `json:"uuid"` }
ClusterListRegistriesResponse provides the list of cluster registries by cluster name
type ClusterListRequest ¶
type ClusterListRequest struct{}
ClusterListRequest requests a full list of k8s clusters
type ClusterListResponse ¶
type ClusterListResponse []struct { EtcdConfig EtcdConfig `json:"etcd_config"` KubeapiServerIpv4Address string `json:"kubeapi_server_ipv4_address"` MasterConfig MasterConfig `json:"master_config"` Name string `json:"name"` Status string `json:"status"` UUID string `json:"uuid"` Version string `json:"version"` WorkerConfig WorkerConfig `json:"worker_config"` }
ClusterListResponse returns a full list of the clusters along with cluster details in a slice
type ClusterRemoveRegistryRequest ¶
type ClusterRemoveRegistryRequest struct{}
type ClusterRemoveRegistryResponse ¶
type ClusterRemoveRegistryResponse struct{}
type ClusterService ¶
type ClusterService Service
ClusterService handles communication to the clusters REST API endpoint
func (*ClusterService) Create ¶
func (cs *ClusterService) Create(reqdata *ClusterCreateRequest) (*ClusterCreateResponse, *http.Response, error)
Create makes the call to cluster create
func (*ClusterService) Delete ¶
func (cs *ClusterService) Delete(reqdata *ClusterDeleteRequest) (*ClusterDeleteResponse, *http.Response, error)
Delete identified cluster by name defining whether to allow cluster deletion during cluster deployment with skip-pre-check
func (*ClusterService) Get ¶
func (cs *ClusterService) Get(reqdata *ClusterGetRequest) (*ClusterGetResponse, *http.Response, error)
Get Get all the k8s cluster objects, which include worker, etcd and master configuration details.
func (*ClusterService) GetHealth ¶
func (cs *ClusterService) GetHealth(reqdata *ClusterGetHealthRequest) (*ClusterGetHealthResponse, *http.Response, error)
GetHealth will return cluster health for cluster name
func (*ClusterService) GetKubeConfig ¶
func (cs *ClusterService) GetKubeConfig(reqdata *ClusterGetKubeConfigRequest) (*ClusterGetKubeConfigResponse, *http.Response, error)
GetKubeConfig Get the kubeconfig to access the K8s cluster.
func (*ClusterService) GetSSH ¶
func (cs *ClusterService) GetSSH(reqdata *ClusterGetSSHRequest) (*ClusterGetSSHResponse, *http.Response, error)
GetSSH Gets the associated k8s SSH credentials to remotely access the k8s cluster. Credentials expire in 24 hours.
func (*ClusterService) List ¶
func (cs *ClusterService) List(reqdata *ClusterListRequest) (*ClusterListResponse, *http.Response, error)
List Get all the k8s cluster objects, which include worker, etcd and master configuration details.
func (*ClusterService) ListRegistries ¶
func (cs *ClusterService) ListRegistries(reqdata *ClusterListRegistriesRequest) (*ClusterListRegistriesResponse, *http.Response, error)
ListRegistries will list the private registries associated with a cluster
func (*ClusterService) UpdateSecret ¶
func (cs *ClusterService) UpdateSecret(reqdata *ClusterUpdateSecretRequest) (*ClusterUpdateSecretResponse, *http.Response, error)
UpdateSecret the k8s secret and docker volume plugin password across k8s clusters deployed in Karbon. The update operation is performed only for the clusters where the provided Prism Element UUID and the username match.
type ClusterUpdateSecretResponse ¶
type ClusterUpdateSecretResponse struct {
TaskUUID string `json:"task_uuid"`
}
type CniConfig ¶
type CniConfig struct { CalicoConfig CalicoConfig `json:"calico_config"` FlannelConfig FlannelConfig `json:"flannel_config"` NodeCidrMaskSize int `json:"node_cidr_mask_size"` PodIpv4Cidr string `json:"pod_ipv4_cidr"` ServiceIpv4Cidr string `json:"service_ipv4_cidr"` }
type CreateEtcdConfig ¶
type CreateEtcdConfig struct {
NodePools []NodePools `json:"node_pools"`
}
type DeleteSkipCheck ¶
type DeleteSkipCheck struct {
SkipCheck bool `url:"skip-prechecks"`
}
DeleteSkipCheck is used within the delete cluster call to pass into query parameters
type EtcdConfig ¶
type EtcdConfig struct {
NodePools []string `json:"node_pools"`
}
type ExternalLbConfig ¶
type ExternalLbConfig struct { ExternalIpv4Address string `json:"external_ipv4_address"` MasterNodesConfig []MasterNodesConfig `json:"master_nodes_config"` }
type FlannelConfig ¶
type FlannelConfig struct { }
type IPPoolConfigs ¶
type IPPoolConfigs struct {
Cidr string `json:"cidr"`
}
type MasterConfig ¶
type MasterNodesConfig ¶
type MastersConfig ¶
type MastersConfig struct { ActivePassiveConfig ActivePassiveConfig `json:"active_passive_config"` ExternalLbConfig ExternalLbConfig `json:"external_lb_config"` NodePools []NodePools `json:"node_pools"` SingleMasterConfig SingleMasterConfig `json:"single_master_config"` }
type MetaGetRequest ¶
type MetaGetRequest struct{}
MetaGetRequest gets a detailed list of version data
type MetaGetResponse ¶
type MetaGetResponse struct { BuildDate string `json:"build_date"` GitCommit string `json:"git_commit"` Version string `json:"version"` }
MetaGetResponse are the version details
type MetaService ¶
type MetaService Service
MetaService handles communication to the clusters REST API endpoint
func (*MetaService) GetVersion ¶
func (ms *MetaService) GetVersion(reqdata *MetaGetRequest) (*MetaGetResponse, *http.Response, error)
GetVersion Get the Karbon controller version of the k8 cluster.
type RegistryCreateRequest ¶
RegistryCreateRequest is the request needed to create registries
type RegistryCreateResponse ¶
type RegistryCreateResponse struct { Endpoint string `json:"endpoint"` Name string `json:"name"` UUID string `json:"uuid"` }
RegistryCreateResponse is the request needed to create registries
type RegistryDeleteRequest ¶
type RegistryDeleteRequest struct {
Name string `json:"name"`
}
RegistryDeleteRequest is the request needed to delete registries
type RegistryDeleteResponse ¶
type RegistryDeleteResponse struct {
RegistryName string `json:"registry_name"`
}
RegistryDeleteResponse is the request needed to delete registries
type RegistryGetRequest ¶
type RegistryGetRequest struct {
Name string `json:"name"`
}
RegistryGetRequest is the request needed to get registries
type RegistryGetResponse ¶
type RegistryGetResponse struct { Endpoint string `json:"endpoint"` Name string `json:"name"` UUID string `json:"uuid"` }
RegistryGetResponse is the request needed to get registries
type RegistryListRequest ¶
type RegistryListRequest struct{}
RegistryListRequest is the request needed to get a list of registries
type RegistryListResponse ¶
type RegistryListResponse struct { Endpoint string `json:"endpoint"` Name string `json:"name"` UUID string `json:"uuid"` }
RegistryListResponse is the request needed to get a list of registries
type RegistryService ¶
type RegistryService Service
RegistryService handles communication to the clusters REST API endpoint
func (*RegistryService) Create ¶
func (rs *RegistryService) Create(reqdata *RegistryCreateRequest) (*RegistryCreateResponse, *http.Response, error)
Create makes the call to cluster list
func (*RegistryService) Delete ¶
func (rs *RegistryService) Delete(reqdata *RegistryDeleteRequest) (*RegistryDeleteResponse, *http.Response, error)
Delete will delete the virtual machine associated with the provided UUID
func (*RegistryService) Get ¶
func (rs *RegistryService) Get(reqdata *RegistryGetRequest) (*RegistryGetResponse, *http.Response, error)
Get passes as name of a specific registry to get information about that registry
func (*RegistryService) List ¶
func (rs *RegistryService) List(reqdata *RegistryGetRequest) (*RegistryGetResponse, *http.Response, error)
List returns a list of all registries
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is used to create endpoint specific services to utilize concurrency with timeouts
type ServiceConfig ¶
ServiceConfig is the configuration to use PC
type SingleMasterConfig ¶
type SingleMasterConfig struct { }
type StorageClassConfig ¶
type StorageClassConfig struct { DefaultStorageClass bool `json:"default_storage_class"` Name string `json:"name"` ReclaimPolicy string `json:"reclaim_policy"` VolumesConfig VolumesConfig `json:"volumes_config"` }
type VolumesConfig ¶
type WorkerConfig ¶
type WorkerConfig struct {
NodePools []string `json:"node_pools"`
}
type WorkersConfig ¶
type WorkersConfig struct {
NodePools []NodePools `json:"node_pools"`
}