mirror of
https://github.com/rancher/types.git
synced 2025-09-25 12:21:24 +00:00
Update generated code
This commit is contained in:
@@ -64,7 +64,9 @@ type CatalogOperations interface {
|
||||
ByID(id string) (*Catalog, error)
|
||||
Delete(container *Catalog) error
|
||||
|
||||
ActionRefresh(resource *CatalogCollection) error
|
||||
ActionRefresh(resource *Catalog) error
|
||||
|
||||
CollectionActionRefresh(resource *CatalogCollection) error
|
||||
}
|
||||
|
||||
func newCatalogClient(apiClient *Client) *CatalogClient {
|
||||
@@ -112,8 +114,12 @@ func (c *CatalogClient) Delete(container *Catalog) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(CatalogType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *CatalogClient) ActionRefresh(resource *CatalogCollection) error {
|
||||
func (c *CatalogClient) ActionRefresh(resource *Catalog) error {
|
||||
err := c.apiClient.Ops.DoAction(CatalogType, "refresh", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *CatalogClient) CollectionActionRefresh(resource *CatalogCollection) error {
|
||||
err := c.apiClient.Ops.DoCollectionAction(CatalogType, "refresh", &resource.Collection, nil, nil)
|
||||
return err
|
||||
|
||||
}
|
||||
|
@@ -98,9 +98,9 @@ type ClusterOperations interface {
|
||||
ByID(id string) (*Cluster, error)
|
||||
Delete(container *Cluster) error
|
||||
|
||||
ActionGenerateKubeconfig(*Cluster) (*GenerateKubeConfigOutput, error)
|
||||
ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error)
|
||||
|
||||
ActionImportYaml(*Cluster, *ImportClusterYamlInput) (*ImportYamlOutput, error)
|
||||
ActionImportYaml(resource *Cluster, input *ImportClusterYamlInput) (*ImportYamlOutput, error)
|
||||
}
|
||||
|
||||
func newClusterClient(apiClient *Client) *ClusterClient {
|
||||
@@ -149,19 +149,13 @@ func (c *ClusterClient) Delete(container *Cluster) error {
|
||||
}
|
||||
|
||||
func (c *ClusterClient) ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error) {
|
||||
|
||||
resp := &GenerateKubeConfigOutput{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(ClusterType, "generateKubeconfig", &resource.Resource, nil, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterClient) ActionImportYaml(resource *Cluster, input *ImportClusterYamlInput) (*ImportYamlOutput, error) {
|
||||
|
||||
resp := &ImportYamlOutput{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(ClusterType, "importYaml", &resource.Resource, input, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
@@ -71,6 +71,14 @@ type ClusterAlertOperations interface {
|
||||
Update(existing *ClusterAlert, updates interface{}) (*ClusterAlert, error)
|
||||
ByID(id string) (*ClusterAlert, error)
|
||||
Delete(container *ClusterAlert) error
|
||||
|
||||
ActionActivate(resource *ClusterAlert) error
|
||||
|
||||
ActionDeactivate(resource *ClusterAlert) error
|
||||
|
||||
ActionMute(resource *ClusterAlert) error
|
||||
|
||||
ActionUnmute(resource *ClusterAlert) error
|
||||
}
|
||||
|
||||
func newClusterAlertClient(apiClient *Client) *ClusterAlertClient {
|
||||
@@ -117,3 +125,23 @@ func (c *ClusterAlertClient) ByID(id string) (*ClusterAlert, error) {
|
||||
func (c *ClusterAlertClient) Delete(container *ClusterAlert) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ClusterAlertType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *ClusterAlertClient) ActionActivate(resource *ClusterAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterAlertType, "activate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ClusterAlertClient) ActionDeactivate(resource *ClusterAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterAlertType, "deactivate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ClusterAlertClient) ActionMute(resource *ClusterAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterAlertType, "mute", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ClusterAlertClient) ActionUnmute(resource *ClusterAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterAlertType, "unmute", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -60,7 +60,13 @@ type ClusterPipelineOperations interface {
|
||||
ByID(id string) (*ClusterPipeline, error)
|
||||
Delete(container *ClusterPipeline) error
|
||||
|
||||
ActionAuthuser(*ClusterPipeline, *AuthUserInput) (*SourceCodeCredential, error)
|
||||
ActionAuthuser(resource *ClusterPipeline, input *AuthUserInput) (*SourceCodeCredential, error)
|
||||
|
||||
ActionDeploy(resource *ClusterPipeline) error
|
||||
|
||||
ActionDestroy(resource *ClusterPipeline) error
|
||||
|
||||
ActionRevokeapp(resource *ClusterPipeline) error
|
||||
}
|
||||
|
||||
func newClusterPipelineClient(apiClient *Client) *ClusterPipelineClient {
|
||||
@@ -109,10 +115,22 @@ func (c *ClusterPipelineClient) Delete(container *ClusterPipeline) error {
|
||||
}
|
||||
|
||||
func (c *ClusterPipelineClient) ActionAuthuser(resource *ClusterPipeline, input *AuthUserInput) (*SourceCodeCredential, error) {
|
||||
|
||||
resp := &SourceCodeCredential{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(ClusterPipelineType, "authuser", &resource.Resource, input, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ClusterPipelineClient) ActionDeploy(resource *ClusterPipeline) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterPipelineType, "deploy", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ClusterPipelineClient) ActionDestroy(resource *ClusterPipeline) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterPipelineType, "destroy", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ClusterPipelineClient) ActionRevokeapp(resource *ClusterPipeline) error {
|
||||
err := c.apiClient.Ops.DoAction(ClusterPipelineType, "revokeapp", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -68,9 +68,9 @@ type NodeDriverOperations interface {
|
||||
ByID(id string) (*NodeDriver, error)
|
||||
Delete(container *NodeDriver) error
|
||||
|
||||
ActionActivate(*NodeDriver) (*NodeDriver, error)
|
||||
ActionActivate(resource *NodeDriver) (*NodeDriver, error)
|
||||
|
||||
ActionDeactivate(*NodeDriver) (*NodeDriver, error)
|
||||
ActionDeactivate(resource *NodeDriver) (*NodeDriver, error)
|
||||
}
|
||||
|
||||
func newNodeDriverClient(apiClient *Client) *NodeDriverClient {
|
||||
@@ -119,19 +119,13 @@ func (c *NodeDriverClient) Delete(container *NodeDriver) error {
|
||||
}
|
||||
|
||||
func (c *NodeDriverClient) ActionActivate(resource *NodeDriver) (*NodeDriver, error) {
|
||||
|
||||
resp := &NodeDriver{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(NodeDriverType, "activate", &resource.Resource, nil, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *NodeDriverClient) ActionDeactivate(resource *NodeDriver) (*NodeDriver, error) {
|
||||
|
||||
resp := &NodeDriver{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(NodeDriverType, "deactivate", &resource.Resource, nil, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
@@ -66,7 +66,9 @@ type NotifierOperations interface {
|
||||
ByID(id string) (*Notifier, error)
|
||||
Delete(container *Notifier) error
|
||||
|
||||
ActionSend(resource *NotifierCollection, input *Notification) error
|
||||
ActionSend(resource *Notifier, input *Notification) error
|
||||
|
||||
CollectionActionSend(resource *NotifierCollection, input *Notification) error
|
||||
}
|
||||
|
||||
func newNotifierClient(apiClient *Client) *NotifierClient {
|
||||
@@ -114,8 +116,12 @@ func (c *NotifierClient) Delete(container *Notifier) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(NotifierType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *NotifierClient) ActionSend(resource *NotifierCollection, input *Notification) error {
|
||||
func (c *NotifierClient) ActionSend(resource *Notifier, input *Notification) error {
|
||||
err := c.apiClient.Ops.DoAction(NotifierType, "send", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *NotifierClient) CollectionActionSend(resource *NotifierCollection, input *Notification) error {
|
||||
err := c.apiClient.Ops.DoCollectionAction(NotifierType, "send", &resource.Collection, input, nil)
|
||||
return err
|
||||
|
||||
}
|
||||
|
@@ -85,6 +85,12 @@ type PipelineOperations interface {
|
||||
Update(existing *Pipeline, updates interface{}) (*Pipeline, error)
|
||||
ByID(id string) (*Pipeline, error)
|
||||
Delete(container *Pipeline) error
|
||||
|
||||
ActionActivate(resource *Pipeline) error
|
||||
|
||||
ActionDeactivate(resource *Pipeline) error
|
||||
|
||||
ActionRun(resource *Pipeline, input *RunPipelineInput) error
|
||||
}
|
||||
|
||||
func newPipelineClient(apiClient *Client) *PipelineClient {
|
||||
@@ -131,3 +137,18 @@ func (c *PipelineClient) ByID(id string) (*Pipeline, error) {
|
||||
func (c *PipelineClient) Delete(container *Pipeline) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(PipelineType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *PipelineClient) ActionActivate(resource *Pipeline) error {
|
||||
err := c.apiClient.Ops.DoAction(PipelineType, "activate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *PipelineClient) ActionDeactivate(resource *Pipeline) error {
|
||||
err := c.apiClient.Ops.DoAction(PipelineType, "deactivate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *PipelineClient) ActionRun(resource *Pipeline, input *RunPipelineInput) error {
|
||||
err := c.apiClient.Ops.DoAction(PipelineType, "run", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -77,6 +77,10 @@ type PipelineExecutionOperations interface {
|
||||
Update(existing *PipelineExecution, updates interface{}) (*PipelineExecution, error)
|
||||
ByID(id string) (*PipelineExecution, error)
|
||||
Delete(container *PipelineExecution) error
|
||||
|
||||
ActionRerun(resource *PipelineExecution) error
|
||||
|
||||
ActionStop(resource *PipelineExecution) error
|
||||
}
|
||||
|
||||
func newPipelineExecutionClient(apiClient *Client) *PipelineExecutionClient {
|
||||
@@ -123,3 +127,13 @@ func (c *PipelineExecutionClient) ByID(id string) (*PipelineExecution, error) {
|
||||
func (c *PipelineExecutionClient) Delete(container *PipelineExecution) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(PipelineExecutionType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *PipelineExecutionClient) ActionRerun(resource *PipelineExecution) error {
|
||||
err := c.apiClient.Ops.DoAction(PipelineExecutionType, "rerun", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *PipelineExecutionClient) ActionStop(resource *PipelineExecution) error {
|
||||
err := c.apiClient.Ops.DoAction(PipelineExecutionType, "stop", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ type PrincipalOperations interface {
|
||||
ByID(id string) (*Principal, error)
|
||||
Delete(container *Principal) error
|
||||
|
||||
ActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error)
|
||||
CollectionActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error)
|
||||
}
|
||||
|
||||
func newPrincipalClient(apiClient *Client) *PrincipalClient {
|
||||
@@ -108,9 +108,8 @@ func (c *PrincipalClient) Delete(container *Principal) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(PrincipalType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *PrincipalClient) ActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error) {
|
||||
func (c *PrincipalClient) CollectionActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error) {
|
||||
resp := &PrincipalCollection{}
|
||||
err := c.apiClient.Ops.DoCollectionAction(PrincipalType, "search", &resource.Collection, input, resp)
|
||||
return resp, err
|
||||
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ type ProjectOperations interface {
|
||||
ByID(id string) (*Project, error)
|
||||
Delete(container *Project) error
|
||||
|
||||
ActionSetpodsecuritypolicytemplate(*Project, *SetPodSecurityPolicyTemplateInput) (*Project, error)
|
||||
ActionSetpodsecuritypolicytemplate(resource *Project, input *SetPodSecurityPolicyTemplateInput) (*Project, error)
|
||||
}
|
||||
|
||||
func newProjectClient(apiClient *Client) *ProjectClient {
|
||||
@@ -109,10 +109,7 @@ func (c *ProjectClient) Delete(container *Project) error {
|
||||
}
|
||||
|
||||
func (c *ProjectClient) ActionSetpodsecuritypolicytemplate(resource *Project, input *SetPodSecurityPolicyTemplateInput) (*Project, error) {
|
||||
|
||||
resp := &Project{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(ProjectType, "setpodsecuritypolicytemplate", &resource.Resource, input, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
@@ -69,6 +69,14 @@ type ProjectAlertOperations interface {
|
||||
Update(existing *ProjectAlert, updates interface{}) (*ProjectAlert, error)
|
||||
ByID(id string) (*ProjectAlert, error)
|
||||
Delete(container *ProjectAlert) error
|
||||
|
||||
ActionActivate(resource *ProjectAlert) error
|
||||
|
||||
ActionDeactivate(resource *ProjectAlert) error
|
||||
|
||||
ActionMute(resource *ProjectAlert) error
|
||||
|
||||
ActionUnmute(resource *ProjectAlert) error
|
||||
}
|
||||
|
||||
func newProjectAlertClient(apiClient *Client) *ProjectAlertClient {
|
||||
@@ -115,3 +123,23 @@ func (c *ProjectAlertClient) ByID(id string) (*ProjectAlert, error) {
|
||||
func (c *ProjectAlertClient) Delete(container *ProjectAlert) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ProjectAlertType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *ProjectAlertClient) ActionActivate(resource *ProjectAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ProjectAlertType, "activate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ProjectAlertClient) ActionDeactivate(resource *ProjectAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ProjectAlertType, "deactivate", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ProjectAlertClient) ActionMute(resource *ProjectAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ProjectAlertType, "mute", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *ProjectAlertClient) ActionUnmute(resource *ProjectAlert) error {
|
||||
err := c.apiClient.Ops.DoAction(ProjectAlertType, "unmute", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -67,6 +67,8 @@ type SourceCodeCredentialOperations interface {
|
||||
Update(existing *SourceCodeCredential, updates interface{}) (*SourceCodeCredential, error)
|
||||
ByID(id string) (*SourceCodeCredential, error)
|
||||
Delete(container *SourceCodeCredential) error
|
||||
|
||||
ActionRefreshrepos(resource *SourceCodeCredential) error
|
||||
}
|
||||
|
||||
func newSourceCodeCredentialClient(apiClient *Client) *SourceCodeCredentialClient {
|
||||
@@ -113,3 +115,8 @@ func (c *SourceCodeCredentialClient) ByID(id string) (*SourceCodeCredential, err
|
||||
func (c *SourceCodeCredentialClient) Delete(container *SourceCodeCredential) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(SourceCodeCredentialType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *SourceCodeCredentialClient) ActionRefreshrepos(resource *SourceCodeCredential) error {
|
||||
err := c.apiClient.Ops.DoAction(SourceCodeCredentialType, "refreshrepos", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ type TokenOperations interface {
|
||||
ByID(id string) (*Token, error)
|
||||
Delete(container *Token) error
|
||||
|
||||
ActionLogout(resource *TokenCollection) error
|
||||
CollectionActionLogout(resource *TokenCollection) error
|
||||
}
|
||||
|
||||
func newTokenClient(apiClient *Client) *TokenClient {
|
||||
@@ -116,8 +116,7 @@ func (c *TokenClient) Delete(container *Token) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(TokenType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *TokenClient) ActionLogout(resource *TokenCollection) error {
|
||||
func (c *TokenClient) CollectionActionLogout(resource *TokenCollection) error {
|
||||
err := c.apiClient.Ops.DoCollectionAction(TokenType, "logout", &resource.Collection, nil, nil)
|
||||
return err
|
||||
|
||||
}
|
||||
|
@@ -56,9 +56,9 @@ type UserOperations interface {
|
||||
ByID(id string) (*User, error)
|
||||
Delete(container *User) error
|
||||
|
||||
ActionSetpassword(*User, *SetPasswordInput) (*User, error)
|
||||
ActionSetpassword(resource *User, input *SetPasswordInput) (*User, error)
|
||||
|
||||
ActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error
|
||||
CollectionActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error
|
||||
}
|
||||
|
||||
func newUserClient(apiClient *Client) *UserClient {
|
||||
@@ -107,16 +107,12 @@ func (c *UserClient) Delete(container *User) error {
|
||||
}
|
||||
|
||||
func (c *UserClient) ActionSetpassword(resource *User, input *SetPasswordInput) (*User, error) {
|
||||
|
||||
resp := &User{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(UserType, "setpassword", &resource.Resource, input, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *UserClient) ActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error {
|
||||
func (c *UserClient) CollectionActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error {
|
||||
err := c.apiClient.Ops.DoCollectionAction(UserType, "changepassword", &resource.Collection, input, nil)
|
||||
return err
|
||||
|
||||
}
|
||||
|
@@ -71,6 +71,10 @@ type AppOperations interface {
|
||||
Update(existing *App, updates interface{}) (*App, error)
|
||||
ByID(id string) (*App, error)
|
||||
Delete(container *App) error
|
||||
|
||||
ActionRollback(resource *App, input *RollbackRevision) error
|
||||
|
||||
ActionUpgrade(resource *App, input *AppUpgradeConfig) error
|
||||
}
|
||||
|
||||
func newAppClient(apiClient *Client) *AppClient {
|
||||
@@ -117,3 +121,13 @@ func (c *AppClient) ByID(id string) (*App, error) {
|
||||
func (c *AppClient) Delete(container *App) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(AppType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *AppClient) ActionRollback(resource *App, input *RollbackRevision) error {
|
||||
err := c.apiClient.Ops.DoAction(AppType, "rollback", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *AppClient) ActionUpgrade(resource *App, input *AppUpgradeConfig) error {
|
||||
err := c.apiClient.Ops.DoAction(AppType, "upgrade", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ const (
|
||||
ContainerFieldEntrypoint = "entrypoint"
|
||||
ContainerFieldEnvironment = "environment"
|
||||
ContainerFieldEnvironmentFrom = "environmentFrom"
|
||||
ContainerFieldExitCode = "exitCode"
|
||||
ContainerFieldImage = "image"
|
||||
ContainerFieldImagePullPolicy = "imagePullPolicy"
|
||||
ContainerFieldInitContainer = "initContainer"
|
||||
@@ -21,12 +22,15 @@ const (
|
||||
ContainerFieldReadOnly = "readOnly"
|
||||
ContainerFieldReadinessProbe = "readinessProbe"
|
||||
ContainerFieldResources = "resources"
|
||||
ContainerFieldRestartCount = "restartCount"
|
||||
ContainerFieldRunAsNonRoot = "runAsNonRoot"
|
||||
ContainerFieldState = "state"
|
||||
ContainerFieldStdin = "stdin"
|
||||
ContainerFieldStdinOnce = "stdinOnce"
|
||||
ContainerFieldTTY = "tty"
|
||||
ContainerFieldTerminationMessagePath = "terminationMessagePath"
|
||||
ContainerFieldTerminationMessagePolicy = "terminationMessagePolicy"
|
||||
ContainerFieldTransitioningMessage = "transitioningMessage"
|
||||
ContainerFieldUid = "uid"
|
||||
ContainerFieldVolumeMounts = "volumeMounts"
|
||||
ContainerFieldWorkingDir = "workingDir"
|
||||
@@ -40,6 +44,7 @@ type Container struct {
|
||||
Entrypoint []string `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`
|
||||
Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"`
|
||||
EnvironmentFrom []EnvironmentFrom `json:"environmentFrom,omitempty" yaml:"environmentFrom,omitempty"`
|
||||
ExitCode *int64 `json:"exitCode,omitempty" yaml:"exitCode,omitempty"`
|
||||
Image string `json:"image,omitempty" yaml:"image,omitempty"`
|
||||
ImagePullPolicy string `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"`
|
||||
InitContainer bool `json:"initContainer,omitempty" yaml:"initContainer,omitempty"`
|
||||
@@ -52,12 +57,15 @@ type Container struct {
|
||||
ReadOnly *bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
|
||||
ReadinessProbe *Probe `json:"readinessProbe,omitempty" yaml:"readinessProbe,omitempty"`
|
||||
Resources *ResourceRequirements `json:"resources,omitempty" yaml:"resources,omitempty"`
|
||||
RestartCount int64 `json:"restartCount,omitempty" yaml:"restartCount,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" yaml:"runAsNonRoot,omitempty"`
|
||||
State string `json:"state,omitempty" yaml:"state,omitempty"`
|
||||
Stdin bool `json:"stdin,omitempty" yaml:"stdin,omitempty"`
|
||||
StdinOnce bool `json:"stdinOnce,omitempty" yaml:"stdinOnce,omitempty"`
|
||||
TTY bool `json:"tty,omitempty" yaml:"tty,omitempty"`
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty" yaml:"terminationMessagePath,omitempty"`
|
||||
TerminationMessagePolicy string `json:"terminationMessagePolicy,omitempty" yaml:"terminationMessagePolicy,omitempty"`
|
||||
TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty" yaml:"uid,omitempty"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" yaml:"volumeMounts,omitempty"`
|
||||
WorkingDir string `json:"workingDir,omitempty" yaml:"workingDir,omitempty"`
|
||||
|
@@ -117,6 +117,12 @@ type DeploymentOperations interface {
|
||||
Update(existing *Deployment, updates interface{}) (*Deployment, error)
|
||||
ByID(id string) (*Deployment, error)
|
||||
Delete(container *Deployment) error
|
||||
|
||||
ActionPause(resource *Deployment) error
|
||||
|
||||
ActionResume(resource *Deployment) error
|
||||
|
||||
ActionRollback(resource *Deployment, input *DeploymentRollbackInput) error
|
||||
}
|
||||
|
||||
func newDeploymentClient(apiClient *Client) *DeploymentClient {
|
||||
@@ -163,3 +169,18 @@ func (c *DeploymentClient) ByID(id string) (*Deployment, error) {
|
||||
func (c *DeploymentClient) Delete(container *Deployment) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(DeploymentType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *DeploymentClient) ActionPause(resource *Deployment) error {
|
||||
err := c.apiClient.Ops.DoAction(DeploymentType, "pause", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeploymentClient) ActionResume(resource *Deployment) error {
|
||||
err := c.apiClient.Ops.DoAction(DeploymentType, "resume", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeploymentClient) ActionRollback(resource *Deployment, input *DeploymentRollbackInput) error {
|
||||
err := c.apiClient.Ops.DoAction(DeploymentType, "rollback", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
@@ -141,6 +141,12 @@ type WorkloadOperations interface {
|
||||
Update(existing *Workload, updates interface{}) (*Workload, error)
|
||||
ByID(id string) (*Workload, error)
|
||||
Delete(container *Workload) error
|
||||
|
||||
ActionPause(resource *Workload) error
|
||||
|
||||
ActionResume(resource *Workload) error
|
||||
|
||||
ActionRollback(resource *Workload, input *RollbackRevision) error
|
||||
}
|
||||
|
||||
func newWorkloadClient(apiClient *Client) *WorkloadClient {
|
||||
@@ -187,3 +193,18 @@ func (c *WorkloadClient) ByID(id string) (*Workload, error) {
|
||||
func (c *WorkloadClient) Delete(container *Workload) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(WorkloadType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *WorkloadClient) ActionPause(resource *Workload) error {
|
||||
err := c.apiClient.Ops.DoAction(WorkloadType, "pause", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *WorkloadClient) ActionResume(resource *Workload) error {
|
||||
err := c.apiClient.Ops.DoAction(WorkloadType, "resume", &resource.Resource, nil, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *WorkloadClient) ActionRollback(resource *Workload, input *RollbackRevision) error {
|
||||
err := c.apiClient.Ops.DoAction(WorkloadType, "rollback", &resource.Resource, input, nil)
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user