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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue