Documentation ¶
Index ¶
- Variables
- func CheckConfigurationAndInitCloudClient() error
- func DownloadNewCertificate(clusterID sdk.ID) error
- func Init() error
- func PrepareCertificate(clusterID sdk.ID) error
- func SaveCloudLuaModule() (string, error)
- func SaveConfiguration(config *CloudConfiguration) error
- type CloudConfiguration
- type Profile
- type User
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckConfigurationAndInitCloudClient ¶
func CheckConfigurationAndInitCloudClient() error
CheckConfigurationAndInitCloudClient checks if cloud-cli configured the server address and token correctly. Then use this token to initialize the cloud client.
func DownloadNewCertificate ¶
DownloadNewCertificate downloads the new TLS bundle for communicating with API7 Cloud. Note this function doesn't restore the old TLS bundle if the new one is not saved normally on disk. Try to recall this function multiple times to eliminate the corrupted TLS bundle files.
func PrepareCertificate ¶
PrepareCertificate downloads the client certificate and key from API7 Cloud. This certificate is used for the communication between APISIX and API7 Cloud.
func SaveCloudLuaModule ¶
SaveCloudLuaModule downloads the cloud lua module and unzip and untar it, finally it'll be saved to the filesystem and the directory will be returned.
func SaveConfiguration ¶
func SaveConfiguration(config *CloudConfiguration) error
SaveConfiguration to file for persistence
Types ¶
type CloudConfiguration ¶
type CloudConfiguration struct { // DefaultProfile is the active profile. DefaultProfile string `json:"default_profile" yaml:"default_profile"` // Profiles is the list of profiles. Profiles []Profile `json:"profiles" yaml:"profiles"` }
CloudConfiguration is the configuration for the cloud cli.
func LoadConfiguration ¶
func LoadConfiguration() (*CloudConfiguration, error)
LoadConfiguration from file
func (*CloudConfiguration) ConfigureProfile ¶
func (c *CloudConfiguration) ConfigureProfile(profile Profile)
ConfigureProfile adds a profile to the configuration if not exists, otherwise update profile by name.
func (*CloudConfiguration) GetDefaultProfile ¶
func (c *CloudConfiguration) GetDefaultProfile() (*Profile, error)
GetDefaultProfile returns the default profile.
func (*CloudConfiguration) GetProfile ¶
func (c *CloudConfiguration) GetProfile(name string) (*Profile, error)
GetProfile returns the profile by name.
func (*CloudConfiguration) Validate ¶
func (c *CloudConfiguration) Validate() error
Validate validates the configuration.
type Profile ¶
type Profile struct { // Name is the name of the profile. Name string `json:"name" yaml:"name"` // Address is the address of API7 Cloud server. Address string `json:"address" yaml:"address"` // User is the user credential. User User `json:"user" yaml:"user"` }
Profile represents a configuration profile.