Update Rancher API integration to go-rancher client v2.
This commit is contained in:
parent
d89b234cad
commit
07c6e33598
188 changed files with 5349 additions and 1969 deletions
15
vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go
generated
vendored
15
vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go
generated
vendored
|
@ -20,6 +20,7 @@ type Client interface {
|
|||
GetSelfStack() (Stack, error)
|
||||
GetServices() ([]Service, error)
|
||||
GetStacks() ([]Stack, error)
|
||||
GetStackByName(string) (Stack, error)
|
||||
GetContainers() ([]Container, error)
|
||||
GetServiceContainers(string, string) ([]Container, error)
|
||||
GetHosts() ([]Host, error)
|
||||
|
@ -190,6 +191,20 @@ func (m *client) GetStacks() ([]Stack, error) {
|
|||
return stacks, nil
|
||||
}
|
||||
|
||||
func (m *client) GetStackByName(name string) (Stack, error) {
|
||||
resp, err := m.SendRequest("/stacks/" + name)
|
||||
var stack Stack
|
||||
if err != nil {
|
||||
return stack, err
|
||||
}
|
||||
|
||||
if err = json.Unmarshal(resp, &stack); err != nil {
|
||||
return stack, err
|
||||
}
|
||||
|
||||
return stack, nil
|
||||
}
|
||||
|
||||
func (m *client) GetContainers() ([]Container, error) {
|
||||
resp, err := m.SendRequest("/containers")
|
||||
var containers []Container
|
||||
|
|
37
vendor/github.com/rancher/go-rancher-metadata/metadata/types.go
generated
vendored
37
vendor/github.com/rancher/go-rancher-metadata/metadata/types.go
generated
vendored
|
@ -43,6 +43,8 @@ type Service struct {
|
|||
EnvironmentUUID string `json:"environment_uuid"`
|
||||
State string `json:"state"`
|
||||
System bool `json:"system"`
|
||||
EnvironmentName string `json:"environment_name"`
|
||||
Selector string `json:"selector"`
|
||||
}
|
||||
|
||||
type Container struct {
|
||||
|
@ -54,6 +56,7 @@ type Container struct {
|
|||
ServiceName string `json:"service_name"`
|
||||
ServiceIndex string `json:"service_index"`
|
||||
StackName string `json:"stack_name"`
|
||||
StackUUID string `json:"stack_uuid"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
CreateIndex int `json:"create_index"`
|
||||
HostUUID string `json:"host_uuid"`
|
||||
|
@ -73,6 +76,8 @@ type Container struct {
|
|||
System bool `json:"system"`
|
||||
EnvironmentUUID string `json:"environment_uuid"`
|
||||
HealthCheck HealthCheck `json:"health_check"`
|
||||
EnvironmentName string `json:"environment_name"`
|
||||
ServiceUUID string `json:"service_uuid"`
|
||||
}
|
||||
|
||||
type Network struct {
|
||||
|
@ -97,27 +102,29 @@ type Host struct {
|
|||
MilliCPU int64 `json:"milli_cpu"`
|
||||
LocalStorageMb int64 `json:"local_storage_mb"`
|
||||
EnvironmentUUID string `json:"environment_uuid"`
|
||||
State string `json:"state"`
|
||||
}
|
||||
|
||||
type PortRule struct {
|
||||
SourcePort int `json:"source_port"`
|
||||
Protocol string `json:"protocol"`
|
||||
Path string `json:"path"`
|
||||
Hostname string `json:"hostname"`
|
||||
Service string `json:"service"`
|
||||
TargetPort int `json:"target_port"`
|
||||
Priority int `json:"priority"`
|
||||
BackendName string `json:"backend_name"`
|
||||
Selector string `json:"selector"`
|
||||
Container string `json:"container"`
|
||||
SourcePort int `json:"source_port"`
|
||||
Protocol string `json:"protocol"`
|
||||
Path string `json:"path"`
|
||||
Hostname string `json:"hostname"`
|
||||
Service string `json:"service"`
|
||||
TargetPort int `json:"target_port"`
|
||||
Priority int `json:"priority"`
|
||||
BackendName string `json:"backend_name"`
|
||||
Selector string `json:"selector"`
|
||||
Container string `json:"container"`
|
||||
ContainerUUID string `json:"container_uuid"`
|
||||
}
|
||||
|
||||
type LBConfig struct {
|
||||
Certs []string `json:"certs"`
|
||||
DefaultCert string `json:"default_cert"`
|
||||
PortRules []PortRule `json:"port_rules"`
|
||||
Config string `json:"config"`
|
||||
StickinessPolicy LBStickinessPolicy `json:"stickiness_policy"`
|
||||
CertificateIDs []string `json:"certificate_ids"`
|
||||
DefaultCertificateID string `json:"default_certificate_id"`
|
||||
PortRules []PortRule `json:"port_rules"`
|
||||
Config string `json:"config"`
|
||||
StickinessPolicy LBStickinessPolicy `json:"stickiness_policy"`
|
||||
}
|
||||
|
||||
type LBStickinessPolicy struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue