Documentation
¶
Index ¶
- type APIClient
- type App
- type AppClient
- type AppTemplate
- type AppTemplateClient
- type AuthClient
- type Client
- func (client *Client) APIServer() string
- func (client *Client) CordonNode(ip string, cluster string) error
- func (client *Client) CreateApp(data *CreateAppData, filePath string) error
- func (client *Client) CreateAppTemplate(data *CreateAppTemplateData, filePath string) error
- func (client *Client) CreateConfig(data *CreateConfigData) error
- func (client *Client) CreateService(data *CreateServiceData) error
- func (client *Client) CreateVolume(data *CreateVolumeData) error
- func (client *Client) DownloadAppTemplate(name string, filePath string) error
- func (client *Client) DrainNode(ip string, cluster string) error
- func (client *Client) Initialize(apiServer string, namespace string, token string)
- func (client *Client) InspectApp(name string) (*App, error)
- func (client *Client) InspectAppTemplate(name string) (*AppTemplate, error)
- func (client *Client) InspectCluster(name string) (*Cluster, error)
- func (client *Client) InspectConfig(name string) (*Config, error)
- func (client *Client) InspectLoadBalancer(name string) (*LoadBalancer, error)
- func (client *Client) InspectNode(ip string, cluster string) (*Node, error)
- func (client *Client) InspectService(name string, params *ServiceParams) (*Service, error)
- func (client *Client) InspectSpace(name string) (*Space, error)
- func (client *Client) InspectVolume(id string) (*Volume, error)
- func (client *Client) ListAppTemplates() (*ListAppTemplatesResult, error)
- func (client *Client) ListApps(params *ListAppsParams) (*ListAppsResult, error)
- func (client *Client) ListClusters() (*ListClustersResult, error)
- func (client *Client) ListConfigs() (*ListConfigsResult, error)
- func (client *Client) ListImageTags(registryName string, projectName string, imageName string) (*ListImageTagsResult, error)
- func (client *Client) ListImages(registryName string, projectName string) (*ListImagesResult, error)
- func (client *Client) ListLoadBalancers(params *ListLoadBalancersParams) (*ListLoadBalancersResult, error)
- func (client *Client) ListNodes(cluster string) (*ListNodesResult, error)
- func (client *Client) ListRegistries() (*ListRegistriesResult, error)
- func (client *Client) ListRegistryProjects(registryName string) (*ListRegistryProjectsResult, error)
- func (client *Client) ListServices(params *ListServicesParams) (*ListServicesResult, error)
- func (client *Client) ListSpaces() (*ListSpacesResult, error)
- func (client *Client) ListVolumes(params *ListVolumesParams) (*ListVolumesResult, error)
- func (client *Client) Login(data *LoginData) (*LoginResult, error)
- func (client *Client) Namespace() string
- func (client *Client) RemoveApp(name string) error
- func (client *Client) RemoveAppTemplate(name string) error
- func (client *Client) RemoveConfig(name string) error
- func (client *Client) RemoveService(name string, params *ServiceParams) error
- func (client *Client) RemoveVolume(id string) error
- func (client *Client) RestartService(name string, params *ServiceParams) error
- func (client *Client) ScaleService(name string, data *ScaleServiceData, params *ServiceParams) error
- func (client *Client) SetNodeLabels(ip string, cluster string, data *SetNodeLabelsData) error
- func (client *Client) StartApp(name string) error
- func (client *Client) StartService(name string, params *ServiceParams) error
- func (client *Client) StopApp(name string) error
- func (client *Client) StopService(name string, params *ServiceParams) error
- func (client *Client) Token() string
- func (client *Client) UncordonNode(ip string, cluster string) error
- func (client *Client) UpdateAppTemplate(name string, data *UpdateAppTemplateData, filePath string) error
- func (client *Client) UpdateLoadBalancer(name string, data *UpdateLoadBalancerData) error
- func (client *Client) UpdateService(name string, data *UpdateServiceData, params *ServiceParams) error
- type Cluster
- type ClusterAttributes
- type ClusterClient
- type ClusterCloudInfo
- type Config
- type ConfigClient
- type ConfigItem
- type CreateAppData
- type CreateAppTemplateData
- type CreateConfigData
- type CreateServiceData
- type CreateVolumeData
- type Image
- type ImageClient
- type ListAppTemplatesResult
- type ListAppsParams
- type ListAppsResult
- type ListClustersResult
- type ListConfigsResult
- type ListImageTagsResult
- type ListImagesResult
- type ListLoadBalancersParams
- type ListLoadBalancersResult
- type ListNodesResult
- type ListRegistriesResult
- type ListRegistryProjectsResult
- type ListServicesParams
- type ListServicesResult
- type ListSpacesResult
- type ListVolumesParams
- type ListVolumesResult
- type Listener
- type ListenerData
- type LoadBalancer
- type LoadBalancerClient
- type LoginData
- type LoginResult
- type Node
- type NodeAttributes
- type NodeClient
- type NodeLabel
- type NodeResources
- type Registry
- type RegistryClient
- type RegistryProject
- type ScaleServiceData
- type Service
- type ServiceClient
- type ServiceConfig
- type ServiceConfigValue
- type ServiceInstanceSize
- type ServiceListener
- type ServiceLoadBalancer
- type ServiceParams
- type ServiceVolume
- type SetNodeLabelsData
- type Space
- type SpaceClient
- type UpdateAppTemplateData
- type UpdateLoadBalancerData
- type UpdateServiceData
- type Volume
- type VolumeClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
APIServer() string
Namespace() string
Token() string
Initialize(string, string, string)
AuthClient
ServiceClient
SpaceClient
ClusterClient
LoadBalancerClient
VolumeClient
AppClient
AppTemplateClient
ConfigClient
RegistryClient
ImageClient
NodeClient
}
APIClient is the interface implemented by the Alauda API client.
type App ¶
type App struct {
Name string `json:"app_name"`
ID string `json:"uuid"`
State string `json:"current_status"`
CreatedBy string `json:"created_by"`
Services []Service `json:"services"`
}
App defines the response body of the InspectApp API.
type AppClient ¶
type AppClient interface {
CreateApp(*CreateAppData, string) error
ListApps(*ListAppsParams) (*ListAppsResult, error)
InspectApp(string) (*App, error)
StartApp(string) error
StopApp(string) error
RemoveApp(string) error
}
AppClient is the API client for the app related APIs.
type AppTemplate ¶ added in v1.1.0
type AppTemplate struct {
Name string `json:"name"`
ID string `json:"uuid"`
Description string `json:"description"`
Template string `json:"template"`
CreatedAt string `json:"created_at"`
CreatedBy string `json:"created_by"`
UpdatedAt string `json:"updated_at"`
Services []Service `json:"services"`
}
AppTemplate defines the response body of the InspectAppTemplate API.
type AppTemplateClient ¶ added in v1.1.0
type AppTemplateClient interface {
CreateAppTemplate(*CreateAppTemplateData, string) error
ListAppTemplates() (*ListAppTemplatesResult, error)
InspectAppTemplate(string) (*AppTemplate, error)
DownloadAppTemplate(string, string) error
UpdateAppTemplate(string, *UpdateAppTemplateData, string) error
RemoveAppTemplate(string) error
}
AppTemplateClient is the API client for the app template related APIs.
type AuthClient ¶
type AuthClient interface {
Login(*LoginData) (*LoginResult, error)
}
AuthClient is the API client for authentication related APIs.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API client for the Alauda platform.
func (*Client) CordonNode ¶ added in v1.3.0
CordonNode makes the specific node unschedulable.
func (*Client) CreateApp ¶
func (client *Client) CreateApp(data *CreateAppData, filePath string) error
CreateApp creates and starts the specified application.
func (*Client) CreateAppTemplate ¶ added in v1.1.0
func (client *Client) CreateAppTemplate(data *CreateAppTemplateData, filePath string) error
CreateAppTemplate creates a new app template.
func (*Client) CreateConfig ¶ added in v1.1.0
func (client *Client) CreateConfig(data *CreateConfigData) error
CreateConfig creates a configuration.
func (*Client) CreateService ¶
func (client *Client) CreateService(data *CreateServiceData) error
CreateService creates and deploys a new service.
func (*Client) CreateVolume ¶
func (client *Client) CreateVolume(data *CreateVolumeData) error
CreateVolume creates a new volume.
func (*Client) DownloadAppTemplate ¶ added in v1.1.0
DownloadAppTemplate downloads a specific app template.
func (*Client) DrainNode ¶ added in v1.3.0
DrainNode migrates containers off a node and makes it unschedulable.
func (*Client) Initialize ¶
Initialize should be called before using the client.
func (*Client) InspectApp ¶
InspectApp retrieves details about a specific application.
func (*Client) InspectAppTemplate ¶ added in v1.1.0
func (client *Client) InspectAppTemplate(name string) (*AppTemplate, error)
InspectAppTemplate retrieves details about a specific app template.
func (*Client) InspectCluster ¶
InspectCluster retrieves details about the specified cluster.
func (*Client) InspectConfig ¶ added in v1.1.0
InspectConfig retrieves details about the specified configuration.
func (*Client) InspectLoadBalancer ¶
func (client *Client) InspectLoadBalancer(name string) (*LoadBalancer, error)
InspectLoadBalancer retrieves details about a specific LB.
func (*Client) InspectNode ¶ added in v1.2.0
InspectNode retrieves details about the specified node.
func (*Client) InspectService ¶
func (client *Client) InspectService(name string, params *ServiceParams) (*Service, error)
InspectService retrieves details about the specified service.
func (*Client) InspectSpace ¶
InspectSpace retrieves details about a specific space.
func (*Client) InspectVolume ¶
InspectVolume retrieves details about a specific volume.
func (*Client) ListAppTemplates ¶ added in v1.1.0
func (client *Client) ListAppTemplates() (*ListAppTemplatesResult, error)
ListAppTemplates returns all app templates.
func (*Client) ListApps ¶
func (client *Client) ListApps(params *ListAppsParams) (*ListAppsResult, error)
ListApps returns all apps in a cluster.
func (*Client) ListClusters ¶
func (client *Client) ListClusters() (*ListClustersResult, error)
ListClusters returns all clusters in an account.
func (*Client) ListConfigs ¶ added in v1.1.0
func (client *Client) ListConfigs() (*ListConfigsResult, error)
ListConfigs returns all configurations.
func (*Client) ListImageTags ¶ added in v1.1.0
func (client *Client) ListImageTags(registryName string, projectName string, imageName string) (*ListImageTagsResult, error)
ListImageTags returns the list of tags of an image.
func (*Client) ListImages ¶ added in v1.1.0
func (client *Client) ListImages(registryName string, projectName string) (*ListImagesResult, error)
ListImages returns the list of all images, scoped by the parent registry.
func (*Client) ListLoadBalancers ¶
func (client *Client) ListLoadBalancers(params *ListLoadBalancersParams) (*ListLoadBalancersResult, error)
ListLoadBalancers returns all LBs in a cluster, potentially filtered by a specific service.
func (*Client) ListNodes ¶ added in v1.1.0
func (client *Client) ListNodes(cluster string) (*ListNodesResult, error)
ListNodes returns all nodes in a cluster.
func (*Client) ListRegistries ¶ added in v1.1.0
func (client *Client) ListRegistries() (*ListRegistriesResult, error)
ListRegistries returns the list of all registries in the account.
func (*Client) ListRegistryProjects ¶ added in v1.1.0
func (client *Client) ListRegistryProjects(registryName string) (*ListRegistryProjectsResult, error)
ListRegistryProjects returns the list of projects for a registry.
func (*Client) ListServices ¶
func (client *Client) ListServices(params *ListServicesParams) (*ListServicesResult, error)
ListServices returns all services deployed.
func (*Client) ListSpaces ¶
func (client *Client) ListSpaces() (*ListSpacesResult, error)
ListSpaces returns all spaces in an account.
func (*Client) ListVolumes ¶
func (client *Client) ListVolumes(params *ListVolumesParams) (*ListVolumesResult, error)
ListVolumes returns all volumes in a cluster.
func (*Client) Login ¶
func (client *Client) Login(data *LoginData) (*LoginResult, error)
Login authenticates against the Alauda server.
func (*Client) RemoveAppTemplate ¶ added in v1.1.0
RemoveAppTemplate deletes the specified app template.
func (*Client) RemoveConfig ¶ added in v1.1.0
RemoveConfig deletes the specified configuration.
func (*Client) RemoveService ¶
func (client *Client) RemoveService(name string, params *ServiceParams) error
RemoveService deletes the specified service.
func (*Client) RemoveVolume ¶
RemoveVolume deletes the specified volume.
func (*Client) RestartService ¶
func (client *Client) RestartService(name string, params *ServiceParams) error
RestartService restarts the specified service.
func (*Client) ScaleService ¶
func (client *Client) ScaleService(name string, data *ScaleServiceData, params *ServiceParams) error
ScaleService scales the service to the specified number of instances
func (*Client) SetNodeLabels ¶ added in v1.4.0
func (client *Client) SetNodeLabels(ip string, cluster string, data *SetNodeLabelsData) error
SetNodeLabels sets labels on the specified node.
func (*Client) StartService ¶
func (client *Client) StartService(name string, params *ServiceParams) error
StartService starts the specified service.
func (*Client) StopService ¶
func (client *Client) StopService(name string, params *ServiceParams) error
StopService stops the specified service.
func (*Client) UncordonNode ¶ added in v1.3.0
UncordonNode makes the specific node schedulable again.
func (*Client) UpdateAppTemplate ¶ added in v1.1.0
func (client *Client) UpdateAppTemplate(name string, data *UpdateAppTemplateData, filePath string) error
UpdateAppTemplate updates an app template.
func (*Client) UpdateLoadBalancer ¶
func (client *Client) UpdateLoadBalancer(name string, data *UpdateLoadBalancerData) error
UpdateLoadBalancer creates or removes listeners for the service endpoints on the load balancer.
func (*Client) UpdateService ¶
func (client *Client) UpdateService(name string, data *UpdateServiceData, params *ServiceParams) error
UpdateService scales the service to the specified number of instances
type Cluster ¶
type Cluster struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
ID string `json:"id"`
Type string `json:"container_manager"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
Attributes ClusterAttributes `json:"attr"`
}
Cluster defines the response body for one cluster returned by the ListClusters API.
type ClusterAttributes ¶
type ClusterAttributes struct {
Cloud ClusterCloudInfo `json:"cloud"`
}
ClusterAttributes contains the attributes of a cluster.
type ClusterClient ¶
type ClusterClient interface {
ListClusters() (*ListClustersResult, error)
InspectCluster(string) (*Cluster, error)
}
ClusterClient is the API client for cluster related APIs.
type ClusterCloudInfo ¶
ClusterCloudInfo contains information about the cloud/region the cluster is deployed in.
type Config ¶ added in v1.1.0
type Config struct {
Name string `json:"name"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Description string `json:"description"`
Content []ConfigItem `json:"content"`
}
Config defines the response body for one config returned in the ListConfigs API.
type ConfigClient ¶ added in v1.1.0
type ConfigClient interface {
CreateConfig(*CreateConfigData) error
ListConfigs() (*ListConfigsResult, error)
InspectConfig(string) (*Config, error)
RemoveConfig(string) error
}
ConfigClient is the API client for the config related APIs.
type ConfigItem ¶ added in v1.1.0
ConfigItem defines one configuration item (key-value pair) in a configuration.
type CreateAppData ¶
type CreateAppData struct {
Name string `json:"app_name"`
Cluster string `json:"region"`
Namespace string `json:"namespace"`
Strict bool `json:"strict_mode"`
Timeout int `json:"timeout"`
}
CreateAppData defines the request body for the CreateApp API.
type CreateAppTemplateData ¶ added in v1.1.0
type CreateAppTemplateData struct {
Name string `json:"name"`
Description string `json:"description"`
Space string `json:"space_name"`
}
CreateAppTemplateData defines the request body for the CreateAppTemplate API.
type CreateConfigData ¶ added in v1.1.0
type CreateConfigData struct {
Name string `json:"name"`
Description string `json:"description"`
Space string `json:"space_name"`
Content []ConfigItem `json:"content"`
}
CreateConfigData defines the request body for the CreateConfig API.
type CreateServiceData ¶
type CreateServiceData struct {
Version string `json:"version"`
Name string `json:"service_name"`
Cluster string `json:"region_name"`
Space string `json:"space_name"`
ImageName string `json:"image_name"`
ImageTag string `json:"image_tag"`
Command string `json:"run_command"`
Entrypoint string `json:"entrypoint"`
TargetState string `json:"target_state"`
TargetInstances int `json:"target_num_instances"`
InstanceSize string `json:"instance_size"`
CustomInstanceSize ServiceInstanceSize `json:"custom_instance_size"`
ScalingMode string `json:"scaling_mode"`
Ports []int `json:"ports"`
NetworkMode string `json:"network_mode"`
Env map[string]string `json:"instance_envvars"`
LoadBalancers []ServiceLoadBalancer `json:"load_balancers"`
Volumes []ServiceVolume `json:"volumes"`
Configs []ServiceConfig `json:"mount_points"`
}
CreateServiceData defines the request body for the CreateService API.
type CreateVolumeData ¶
type CreateVolumeData struct {
Name string `json:"name"`
Driver string `json:"driver_name"`
Size int `json:"size"`
ClusterID string `json:"region_id"`
Space string `json:"space_name"`
VolumeType string `json:"volume_type"`
Namespace string `json:"namespace"`
}
CreateVolumeData defines the request body for the CreateVolume API.
type Image ¶ added in v1.1.0
type Image struct {
Name string `json:"name"`
Description string `json:"description"`
ID string `json:"uuid"`
CreatedAt string `json:"created_at"`
CreatedBy string `json:"created_by"`
UpdatedAt string `json:"updated_at"`
PulledAt string `json:"pulled_at"`
PushedAt string `json:"pushed_at"`
Uploads int `json:"upload"`
Downloads int `json:"download"`
IsPublic bool `json:"is_public"`
}
Image defines the response body for one image from the ListImages API.
type ImageClient ¶ added in v1.1.0
type ImageClient interface {
ListImages(string, string) (*ListImagesResult, error)
ListImageTags(string, string, string) (*ListImageTagsResult, error)
}
ImageClient is the API client for the image related APIs.
type ListAppTemplatesResult ¶ added in v1.1.0
type ListAppTemplatesResult struct {
AppTemplates []AppTemplate
}
ListAppTemplatesResult defines the response body for the ListAppTemplates API.
type ListAppsParams ¶
type ListAppsParams struct {
Cluster string
}
ListAppsParams defines the query parameters for the ListApps API.
type ListAppsResult ¶
type ListAppsResult struct {
Apps []App
}
ListAppsResult defines the response body for the ListApps API.
type ListClustersResult ¶
type ListClustersResult struct {
Clusters []Cluster
}
ListClustersResult defines the response body for the ListClusters API.
type ListConfigsResult ¶ added in v1.1.0
ListConfigsResult defines the response body for the ListConfigs API.
type ListImageTagsResult ¶ added in v1.1.0
type ListImageTagsResult struct {
Tags []string
}
ListImageTagsResult defines the response body for the ListImageTags API.
type ListImagesResult ¶ added in v1.1.0
type ListImagesResult struct {
Images []Image
}
ListImagesResult defines the response body for the ListImages API.
type ListLoadBalancersParams ¶
ListLoadBalancersParams defines the query parameters for the ListLoadBalancers API.
type ListLoadBalancersResult ¶
type ListLoadBalancersResult struct {
LoadBalancers []LoadBalancer
}
ListLoadBalancersResult defines the response body for the ListLoadBalancers API.
type ListNodesResult ¶ added in v1.1.0
type ListNodesResult struct {
Nodes []Node
}
ListNodesResult defines the response body for the ListNodes API.
type ListRegistriesResult ¶ added in v1.1.0
type ListRegistriesResult struct {
Registries []Registry
}
ListRegistriesResult defines the response body for the ListRegistries API.
type ListRegistryProjectsResult ¶ added in v1.1.0
type ListRegistryProjectsResult struct {
Projects []RegistryProject
}
ListRegistryProjectsResult defines the response body for the ListRegistryProjects API.
type ListServicesParams ¶
type ListServicesParams struct {
Cluster string
}
ListServicesParams defines the query parameters for the ListServices API.
type ListServicesResult ¶
ListServicesResult defines the response body for the ListServices API.
type ListSpacesResult ¶
type ListSpacesResult struct {
Spaces []Space
}
ListSpacesResult defines the response body for the ListSpaces API.
type ListVolumesParams ¶
type ListVolumesParams struct {
ClusterID string
}
ListVolumesParams defines the query parameters for the ListVolumes API.
type ListVolumesResult ¶
type ListVolumesResult struct {
Volumes []Volume
}
ListVolumesResult defines the response body for the ListVolumes API.
type Listener ¶
type Listener struct {
ServiceID string `json:"service_id"`
ServiceName string `json:"service_name"`
Protocol string `json:"protocol"`
ListenerPort int `json:"listener_port"`
ContainerPort int `json:"container_port"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
Listener defines the response body for one listener from the InspectLoadBalancer API.
type ListenerData ¶
type ListenerData struct {
ServiceID string `json:"service_id"`
Protocol string `json:"protocol"`
ListenerPort int `json:"listener_port"`
ContainerPort int `json:"container_port"`
}
ListenerData defines one listener in the request body for the UpdateLoadBalancer API.
type LoadBalancer ¶
type LoadBalancer struct {
Name string `json:"name"`
ID string `json:"load_balancer_id"`
Type string `json:"type"`
Address string `json:"address"`
AddressType string `json:"address_type"`
CreatedWith string `json:"create_type"`
CreatedAt string `json:"created_at"`
Listeners []Listener `json:"listeners"`
}
LoadBalancer defines the response body of the InspectLoadBalancer API.
type LoadBalancerClient ¶
type LoadBalancerClient interface {
ListLoadBalancers(*ListLoadBalancersParams) (*ListLoadBalancersResult, error)
InspectLoadBalancer(string) (*LoadBalancer, error)
UpdateLoadBalancer(string, *UpdateLoadBalancerData) error
}
LoadBalancerClient is the API client for LB related APIs.
type LoginData ¶
type LoginData struct {
Organization string `json:"organization"`
Username string `json:"username"`
Password string `json:"password"`
}
LoginData defines the request body for the login API.
type LoginResult ¶
type LoginResult struct {
Namespace string `json:"namespace"`
Username string `json:"username"`
Email string `json:"email"`
Token string `json:"token"`
}
LoginResult defines the response body for the login API.
type Node ¶ added in v1.1.0
type Node struct {
IP string `json:"private_ip"`
State string `json:"state"`
Type string `json:"type"`
Attributes NodeAttributes `json:"attr"`
Resources NodeResources `json:"resources"`
Labels []NodeLabel `json:"labels"`
}
Node defines the response body for one node returned by the ListNodes API.
type NodeAttributes ¶ added in v1.3.0
type NodeAttributes struct {
Schedulable bool `json:"schedulable"`
}
NodeAttributes describes the additional attributes of the node.
type NodeClient ¶ added in v1.1.0
type NodeClient interface {
ListNodes(string) (*ListNodesResult, error)
InspectNode(string, string) (*Node, error)
CordonNode(string, string) error
UncordonNode(string, string) error
DrainNode(string, string) error
SetNodeLabels(string, string, *SetNodeLabelsData) error
}
NodeClient is the API client for node related APIs.
type NodeLabel ¶ added in v1.4.0
type NodeLabel struct {
Key string `json:"key"`
Value string `json:"value"`
Editable bool `json:"editable"`
}
NodeLabel describes a label on the node.
type NodeResources ¶ added in v1.1.0
type NodeResources struct {
AvailableMemory string `json:"available_mem"`
AvailableCPUs string `json:"avaliable_cpus"`
TotalMemory string `json:"total_mem"`
TotalCPUs string `json:"total_cpus"`
}
NodeResources describes the total and available resources on a node.
type Registry ¶ added in v1.1.0
type Registry struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
ID string `json:"uuid"`
Endpoint string `json:"endpoint"`
CreatedAt string `json:"created_at"`
CreatedBy string `json:"created_by"`
UpdatedAt string `json:"updated_at"`
Audience string `json:"audience"`
IsPublic bool `json:"is_public"`
Cluster string `json:"region_id"`
Issuer string `json:"issuer"`
}
Registry defines the response body for one registry from the ListRegistries API.
type RegistryClient ¶ added in v1.1.0
type RegistryClient interface {
ListRegistries() (*ListRegistriesResult, error)
ListRegistryProjects(string) (*ListRegistryProjectsResult, error)
}
RegistryClient is the API client for the registry related APIs.
type RegistryProject ¶ added in v1.1.0
type RegistryProject struct {
Name string `json:"project_name"`
ID string `json:"project_id"`
CreatedBy string `json:"created_by"`
RepoCount int `json:"repo_count"`
}
RegistryProject defines the response body for one registry project from the ListRegistryProjects API.
type ScaleServiceData ¶
type ScaleServiceData struct {
TargetInstances int `json:"target_num_instances"`
}
ScaleServiceData defines the request body for the ScaleService API.
type Service ¶
type Service struct {
Name string `json:"service_name"`
ID string `json:"uuid"`
ImageName string `json:"image_name"`
ImageTag string `json:"image_tag"`
Command string `json:"run_command"`
Entrypoint string `json:"entrypoint"`
CreatedAt string `json:"created_at"`
Size ServiceInstanceSize `json:"custom_instance_size"`
Ports []int `json:"ports"`
TargetInstances int `json:"target_num_instances"`
HealthyInstances int `json:"healthy_num_instances"`
State string `json:"current_status"`
NetworkMode string `json:"network_mode"`
Env map[string]string `json:"instance_envvars"`
Volumes []ServiceVolume `json:"volumes"`
}
Service defines the response body for one service returned in the ListServices API.
type ServiceClient ¶
type ServiceClient interface {
CreateService(*CreateServiceData) error
ListServices(*ListServicesParams) (*ListServicesResult, error)
StartService(string, *ServiceParams) error
StopService(string, *ServiceParams) error
RemoveService(string, *ServiceParams) error
InspectService(string, *ServiceParams) (*Service, error)
RestartService(string, *ServiceParams) error
ScaleService(string, *ScaleServiceData, *ServiceParams) error
UpdateService(string, *UpdateServiceData, *ServiceParams) error
}
ServiceClient is the API client for service related APIs.
type ServiceConfig ¶ added in v1.1.0
type ServiceConfig struct {
Type string `json:"type"`
Path string `json:"path"`
Value ServiceConfigValue `json:"value"`
}
ServiceConfig defines the configuration data in the CreateService request.
type ServiceConfigValue ¶ added in v1.1.0
ServiceConfigValue defines the configuration value to be injected into the service.
type ServiceInstanceSize ¶
ServiceInstanceSize defines the size of the service instances.
type ServiceListener ¶
type ServiceListener struct {
ListenerPort int `json:"listener_port"`
ContainerPort int `json:"container_port"`
Protocol string `json:"protocol"`
}
ServiceListener defines the load balancer listener data in the CreateService request.
type ServiceLoadBalancer ¶
type ServiceLoadBalancer struct {
ID string `json:"load_balancer_id"`
Type string `json:"type"`
Listeners []ServiceListener `json:"listeners"`
}
ServiceLoadBalancer defines the load balancer data in the CreateService request.
type ServiceParams ¶
type ServiceParams struct {
App string
}
ServiceParams defines the base query parameters for various service APIs.
type ServiceVolume ¶
type ServiceVolume struct {
Path string `json:"app_volume_dir"`
VolumeName string `json:"volume_name"`
VolumeID string `json:"volume_id"`
}
ServiceVolume defines the volume data in the CreateService request.
type SetNodeLabelsData ¶ added in v1.4.0
SetNodeLabelsData defines the request body for the SetNodeLabels API.
type Space ¶
type Space struct {
ID string `json:"uuid"`
Name string `json:"name"`
Description string `json:"description"`
State string `json:"status"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
}
Space defines the response body for one space returned by the ListSpaces API.
type SpaceClient ¶
type SpaceClient interface {
ListSpaces() (*ListSpacesResult, error)
InspectSpace(string) (*Space, error)
}
SpaceClient is the API client for space related APIs.
type UpdateAppTemplateData ¶ added in v1.1.0
type UpdateAppTemplateData struct {
Name string `json:"name"`
Description string `json:"description"`
}
UpdateAppTemplateData defines the request body for the UpdateAppTemplate API.
type UpdateLoadBalancerData ¶
type UpdateLoadBalancerData struct {
Action string `json:"action"`
Listeners []ListenerData `json:"listeners"`
}
UpdateLoadBalancerData defines the request body for the UpdateLoadBalancer API.
type UpdateServiceData ¶
type UpdateServiceData struct {
ImageTag string `json:"image_tag"`
Command string `json:"run_command"`
Entrypoint string `json:"entrypoint"`
InstanceSize string `json:"instance_size"`
CustomInstanceSize ServiceInstanceSize `json:"custom_instance_size"`
Env map[string]string `json:"instance_envvars"`
}
UpdateServiceData defines the request body for the ScaleService API.
type Volume ¶
type Volume struct {
Name string `json:"name"`
ID string `json:"id"`
Driver string `json:"driver_name"`
State string `json:"state"`
Size int `json:"size"`
CreatedAt string `json:"created_at"`
CreatedBy string `json:"created_by"`
}
Volume defines the response body of the InspectVolume API.
type VolumeClient ¶
type VolumeClient interface {
ListVolumes(*ListVolumesParams) (*ListVolumesResult, error)
InspectVolume(string) (*Volume, error)
CreateVolume(*CreateVolumeData) error
RemoveVolume(string) error
}
VolumeClient is the API client for volume related APIs.
Source Files
¶
- app.go
- app_create.go
- app_inspect.go
- app_list.go
- app_remove.go
- app_start.go
- app_stop.go
- app_template.go
- app_template_create.go
- app_template_download.go
- app_template_inspect.go
- app_template_list.go
- app_template_remove.go
- app_template_update.go
- client.go
- cluster.go
- cluster_inspect.go
- cluster_list.go
- config.go
- config_create.go
- config_inspect.go
- config_list.go
- config_remove.go
- image.go
- image_list.go
- image_tag_list.go
- interface.go
- lb.go
- lb_inspect.go
- lb_list.go
- lb_update.go
- login.go
- node.go
- node_action.go
- node_cordon.go
- node_drain.go
- node_inspect.go
- node_labels_set.go
- node_list.go
- node_uncordon.go
- registry.go
- registry_list.go
- registry_project_list.go
- service.go
- service_create.go
- service_inspect.go
- service_list.go
- service_remove.go
- service_restart.go
- service_scale.go
- service_start.go
- service_stop.go
- service_update.go
- space.go
- space_inspect.go
- space_list.go
- volume.go
- volume_create.go
- volume_inspect.go
- volume_list.go
- volume_remove.go