1
0
mirror of https://github.com/rancher/types.git synced 2025-09-02 05:35:16 +00:00

Go generated

This commit is contained in:
Frank Mai
2019-02-14 12:10:04 +08:00
committed by Craig Jellick
parent abe9de4bb8
commit 003b587a64
5 changed files with 64 additions and 1 deletions

View File

@@ -118,6 +118,8 @@ type ClusterOperations interface {
ActionDisableMonitoring(resource *Cluster) error
ActionEditMonitoring(resource *Cluster, input *MonitoringInput) error
ActionEnableMonitoring(resource *Cluster, input *MonitoringInput) error
ActionExportYaml(resource *Cluster) (*ExportOutput, error)
@@ -129,6 +131,8 @@ type ClusterOperations interface {
ActionRestoreFromEtcdBackup(resource *Cluster, input *RestoreFromEtcdBackupInput) error
ActionRotateCertificates(resource *Cluster, input *RotateCertificateInput) (*RotateCertificateOutput, error)
ActionViewMonitoring(resource *Cluster) (*MonitoringOutput, error)
}
func newClusterClient(apiClient *Client) *ClusterClient {
@@ -192,6 +196,11 @@ func (c *ClusterClient) ActionDisableMonitoring(resource *Cluster) error {
return err
}
func (c *ClusterClient) ActionEditMonitoring(resource *Cluster, input *MonitoringInput) error {
err := c.apiClient.Ops.DoAction(ClusterType, "editMonitoring", &resource.Resource, input, nil)
return err
}
func (c *ClusterClient) ActionEnableMonitoring(resource *Cluster, input *MonitoringInput) error {
err := c.apiClient.Ops.DoAction(ClusterType, "enableMonitoring", &resource.Resource, input, nil)
return err
@@ -225,3 +234,9 @@ func (c *ClusterClient) ActionRotateCertificates(resource *Cluster, input *Rotat
err := c.apiClient.Ops.DoAction(ClusterType, "rotateCertificates", &resource.Resource, input, resp)
return resp, err
}
func (c *ClusterClient) ActionViewMonitoring(resource *Cluster) (*MonitoringOutput, error) {
resp := &MonitoringOutput{}
err := c.apiClient.Ops.DoAction(ClusterType, "viewMonitoring", &resource.Resource, nil, resp)
return resp, err
}

View File

@@ -0,0 +1,10 @@
package client
const (
MonitoringOutputType = "monitoringOutput"
MonitoringOutputFieldAnswers = "answers"
)
type MonitoringOutput struct {
Answers map[string]string `json:"answers,omitempty" yaml:"answers,omitempty"`
}

View File

@@ -74,11 +74,15 @@ type ProjectOperations interface {
ActionDisableMonitoring(resource *Project) error
ActionEditMonitoring(resource *Project, input *MonitoringInput) error
ActionEnableMonitoring(resource *Project, input *MonitoringInput) error
ActionExportYaml(resource *Project) error
ActionSetpodsecuritypolicytemplate(resource *Project, input *SetPodSecurityPolicyTemplateInput) (*Project, error)
ActionViewMonitoring(resource *Project) (*MonitoringOutput, error)
}
func newProjectClient(apiClient *Client) *ProjectClient {
@@ -137,6 +141,11 @@ func (c *ProjectClient) ActionDisableMonitoring(resource *Project) error {
return err
}
func (c *ProjectClient) ActionEditMonitoring(resource *Project, input *MonitoringInput) error {
err := c.apiClient.Ops.DoAction(ProjectType, "editMonitoring", &resource.Resource, input, nil)
return err
}
func (c *ProjectClient) ActionEnableMonitoring(resource *Project, input *MonitoringInput) error {
err := c.apiClient.Ops.DoAction(ProjectType, "enableMonitoring", &resource.Resource, input, nil)
return err
@@ -152,3 +161,9 @@ func (c *ProjectClient) ActionSetpodsecuritypolicytemplate(resource *Project, in
err := c.apiClient.Ops.DoAction(ProjectType, "setpodsecuritypolicytemplate", &resource.Resource, input, resp)
return resp, err
}
func (c *ProjectClient) ActionViewMonitoring(resource *Project) (*MonitoringOutput, error) {
resp := &MonitoringOutput{}
err := c.apiClient.Ops.DoAction(ProjectType, "viewMonitoring", &resource.Resource, nil, resp)
return resp, err
}