1
0
mirror of https://github.com/rancher/types.git synced 2025-08-01 13:07:05 +00:00

generated changes

This commit is contained in:
Daishan Peng 2018-05-24 11:55:24 -07:00 committed by Darren Shepherd
parent 5020bf5159
commit f2566f3a00
2 changed files with 18 additions and 0 deletions

View File

@ -98,6 +98,8 @@ type ClusterOperations interface {
ByID(id string) (*Cluster, error)
Delete(container *Cluster) error
ActionExportYaml(resource *Cluster) (*ExportOutput, error)
ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error)
ActionImportYaml(resource *Cluster, input *ImportClusterYamlInput) (*ImportYamlOutput, error)
@ -148,6 +150,12 @@ func (c *ClusterClient) Delete(container *Cluster) error {
return c.apiClient.Ops.DoResourceDelete(ClusterType, &container.Resource)
}
func (c *ClusterClient) ActionExportYaml(resource *Cluster) (*ExportOutput, error) {
resp := &ExportOutput{}
err := c.apiClient.Ops.DoAction(ClusterType, "exportYaml", &resource.Resource, nil, resp)
return resp, err
}
func (c *ClusterClient) ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error) {
resp := &GenerateKubeConfigOutput{}
err := c.apiClient.Ops.DoAction(ClusterType, "generateKubeconfig", &resource.Resource, nil, resp)

View File

@ -0,0 +1,10 @@
package client
const (
ExportOutputType = "exportOutput"
ExportOutputFieldYAMLOutput = "yamlOutput"
)
type ExportOutput struct {
YAMLOutput string `json:"yamlOutput,omitempty" yaml:"yamlOutput,omitempty"`
}