aslan

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanConfig added in v1.9.9

type CleanConfig struct {
	Cron        string `json:"cron"`
	CronEnabled bool   `json:"cron_enabled"`
}

type Client

type Client struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

func New

func New(host string) *Client

func NewExternal added in v1.4.0

func NewExternal(host, token string) *Client

func (*Client) AddLocalCluster added in v1.8.0

func (c *Client) AddLocalCluster() error

func (*Client) CancelWorkflowTaskV4 added in v1.9.9

func (c *Client) CancelWorkflowTaskV4(userName, workflowName string, taskID int64) error

func (*Client) CreateWorkflowTaskV4 added in v1.9.9

func (c *Client) CreateWorkflowTaskV4(req *CreateWorkflowTaskV4Req) (*CreateTaskV4Resp, error)

func (*Client) DockerClean added in v1.9.9

func (c *Client) DockerClean() error

func (*Client) GetClusterInfo added in v1.9.9

func (c *Client) GetClusterInfo(clusterID string) (*ClusterDetail, error)

func (*Client) GetContainerLog added in v1.4.0

func (c *Client) GetContainerLog(envName, projectName, container, pod string, tailLines int64) (string, error)

func (*Client) GetDefaultLogin added in v1.9.9

func (c *Client) GetDefaultLogin() (*GetDefaultLoginResp, error)

func (*Client) GetDockerCleanConfig added in v1.9.9

func (c *Client) GetDockerCleanConfig() (*CleanConfig, error)

func (*Client) GetEnvironment added in v1.4.0

func (c *Client) GetEnvironment(envName, projectName string) (*Environment, error)

func (*Client) GetLocalCluster added in v1.8.0

func (c *Client) GetLocalCluster() (*clusterResp, error)

func (*Client) GetServiceDetail added in v1.4.0

func (c *Client) GetServiceDetail(projectName, serviceName, envName string) (*ServiceDetail, error)

func (*Client) GetTextFromEncryptedKey added in v1.9.9

func (c *Client) GetTextFromEncryptedKey(encryptedKey string) (*GetAesKeyFromEncryptedKeyResp, error)

func (*Client) GetWorkflowConcurrencySetting added in v1.9.9

func (c *Client) GetWorkflowConcurrencySetting() (*workflowConcurrencySettingResp, error)

func (*Client) Healthz added in v1.8.0

func (c *Client) Healthz() error

Healthz api/health

func (*Client) ListEnvironments added in v1.4.0

func (c *Client) ListEnvironments(projectName string) ([]*Environment, error)

func (*Client) ListRegistries added in v1.9.9

func (c *Client) ListRegistries() ([]*RegistryInfo, error)

func (*Client) ListTestTaskStats

func (c *Client) ListTestTaskStats(log *zap.SugaredLogger) ([]*TestTaskStat, error)

func (*Client) ListTestings

func (c *Client) ListTestings(log *zap.SugaredLogger) ([]*Testing, error)

func (*Client) PatchWorkload added in v1.9.9

func (c *Client) PatchWorkload(projectName, envName, serviceName, devImage string) (*types.WorkloadInfo, error)

func (*Client) RecoverWorkload added in v1.9.9

func (c *Client) RecoverWorkload(projectName, envName, serviceName string) error

type ClusterDetail added in v1.9.9

type ClusterDetail struct {
	ID           primitive.ObjectID       `json:"id,omitempty"              bson:"_id,omitempty"`
	Name         string                   `json:"name"                      bson:"name"`
	Tags         []string                 `json:"tags"                      bson:"tags"`
	Description  string                   `json:"description"               bson:"description"`
	Status       setting.K8SClusterStatus `json:"status"                    bson:"status"`
	Error        string                   `json:"error"                     bson:"error"`
	Yaml         string                   `json:"yaml"                      bson:"yaml"`
	Production   bool                     `json:"production"                bson:"production"`
	CreatedAt    int64                    `json:"createdAt"                 bson:"createdAt"`
	CreatedBy    string                   `json:"createdBy"                 bson:"createdBy"`
	Disconnected bool                     `json:"-"                         bson:"disconnected"`
	Token        string                   `json:"token"                     bson:"-"`
	Provider     int8                     `json:"provider"                  bson:"provider"`
	Local        bool                     `json:"local"                     bson:"local"`
	Cache        types.Cache              `json:"cache"                     bson:"cache"`

	// new field in 1.14, intended to enable kubeconfig for cluster management
	Type       string `json:"type"           bson:"type"` // either agent or kubeconfig supported
	KubeConfig string `json:"kube_config"    bson:"kube_config"`

	// Deprecated field, it should be deleted in version 1.15 since no more namespace settings is used
	Namespace string `json:"namespace"                 bson:"namespace"`
}

type Container added in v1.4.0

type Container struct {
	Name         string `json:"name"`
	Image        string `json:"image"`
	RestartCount int32  `json:"restart_count"`
	Status       string `json:"status"`
	Message      string `json:"message"`
	Reason       string `json:"reason"`
	StartedAt    int64  `json:"started_at,omitempty"`
	FinishedAt   int64  `json:"finished_at,omitempty"`
}

type ContainerImage added in v1.4.0

type ContainerImage struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

type CreateTaskV4Resp added in v1.9.9

type CreateTaskV4Resp struct {
	ProjectName  string `json:"project_name"`
	WorkflowName string `json:"workflow_name"`
	TaskID       int64  `json:"task_id"`
}

type CreateWorkflowTaskV4Req added in v1.9.9

type CreateWorkflowTaskV4Req struct {
	Workflow *models.WorkflowV4
	UserName string
}

type Environment added in v1.4.0

type Environment struct {
	ID          string      `json:"id"`
	ProductName string      `json:"product_name"`
	Namespace   string      `json:"namespace"`
	Status      string      `json:"status"`
	Error       string      `json:"error"`
	EnvName     string      `json:"env_name"`
	UpdateBy    string      `json:"update_by"`
	UpdateTime  int         `json:"update_time"`
	Services    [][]string  `json:"services"`
	Render      *RenderInfo `json:"render"`
	Vars        []*RenderKV `json:"vars,omitempty"`
	IsPublic    bool        `json:"IsPublic"`
	ClusterID   string      `json:"cluster_id,omitempty"`
	RecycleDay  int         `json:"recycle_day"`
	IsProd      bool        `json:"is_prod"`
	Source      string      `json:"source"`
}

type ErrorMessage added in v1.8.0

type ErrorMessage struct {
	Type string `json:"type"`
	Code int    `json:"code"`
}

type GetAesKeyFromEncryptedKeyResp added in v1.9.9

type GetAesKeyFromEncryptedKeyResp struct {
	PlainText string `json:"plain_text"`
}

type GetDefaultLoginResp added in v1.9.9

type GetDefaultLoginResp struct {
	DefaultLogin string `json:"default_login"`
}

type Pod added in v1.4.0

type Pod struct {
	Kind              string            `json:"kind"`
	Name              string            `json:"name"`
	Status            string            `json:"status"`
	Age               string            `json:"age"`
	CreateTime        int64             `json:"createtime"`
	IP                string            `json:"ip"`
	Labels            map[string]string `json:"labels"`
	ContainerStatuses []*Container      `json:"containers"`
}

type RegistryAdvancedSetting added in v1.9.9

type RegistryAdvancedSetting struct {
	// indicator to make sure if the advanced has been modified
	Modified bool `json:"modified"`
	// New field since v1.11 to support self-signed TLS certificate
	TLSEnabled bool   `json:"enable_tls"`
	TLSCert    string `json:"tls_cert"`
	TLSKey     string `json:"tls_key"`
}

type RegistryInfo added in v1.9.9

type RegistryInfo struct {
	ID              primitive.ObjectID       `json:"id,omitempty"`
	RegAddr         string                   `json:"reg_addr"`
	AdvancedSetting *RegistryAdvancedSetting `json:"advanced_setting"`
}

type RenderInfo added in v1.4.0

type RenderInfo struct {
	Name        string `json:"name"`
	Revision    int    `json:"revision"`
	ProductTmpl string `json:"product_tmpl"`
	Description string `json:"description"`
}

type RenderKV added in v1.4.0

type RenderKV struct {
	Key      string   `json:"key"`
	Value    string   `json:"value"`
	Alias    string   `json:"alias"`
	State    string   `json:"state"`
	Services []string `json:"services"`
}

type Service added in v1.4.0

type Service struct {
	ServiceName string   `json:"service_name"`
	Type        string   `json:"type"`
	Status      string   `json:"status"`
	Images      []string `json:"images"`
	ProductName string   `json:"product_name"`
	EnvName     string   `json:"env_name"`
	Ready       string   `json:"ready"`
}

type ServiceDetail added in v1.4.0

type ServiceDetail struct {
	ServiceName string      `json:"service_name"`
	Scales      []*Workload `json:"scales"`
	EnvName     string      `json:"env_name"`
	ProductName string      `json:"product_name"`
	GroupName   string      `json:"group_name"`
}

type ServiceStatus added in v1.4.0

type ServiceStatus struct {
	ServiceName string `json:"service_name"`
	Status      string `json:"status"`
}

type ServicesResp added in v1.4.0

type ServicesResp struct {
	Services []*Service `json:"services"`
}

type TestTaskStat

type TestTaskStat struct {
	Name          string `json:"name"`
	TotalSuccess  int    `json:"totalSuccess"`
	TotalFailure  int    `json:"totalFailure"`
	TotalDuration int64  `json:"totalDuration"`
	TestCaseNum   int    `json:"testCaseNum"`
	CreateTime    int64  `json:"createTime"`
	UpdateTime    int64  `json:"updateTime"`
}

type Testing

type Testing struct {
	Name     string `json:"name"`
	TestType string `json:"test_type"`
}

type Workload added in v1.4.0

type Workload struct {
	Name     string            `json:"name"`
	Type     string            `json:"type"`
	Images   []*ContainerImage `json:"images"`
	Pods     []*Pod            `json:"pods"`
	Replicas int32             `json:"replicas"`
}

Jump to

Keyboard shortcuts

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