instance

package
v0.6.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © LiquidWeb

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastFieldTypes

func CastFieldTypes(source interface{}, dest interface{}) (err error)

func ValidateContext added in v0.5.3

func ValidateContext(wantedContext string, vp *viper.Viper) error

Types

type AllPaginatedResultsArgs

type AllPaginatedResultsArgs struct {
	Method         string
	MethodArgs     map[string]interface{}
	ResultsPerPage int64
}

type Client

type Client struct {
	LwCliApiClient *lwCliInstApi.LwCliApiClient
	Viper          *viper.Viper
}

func New

func New(viper *viper.Viper) (Client, error)

func (*Client) AllPaginatedResults

func (client *Client) AllPaginatedResults(args *AllPaginatedResultsArgs) (apiTypes.MergedPaginatedList, error)

func (*Client) CallLwApiInto

func (client *Client) CallLwApiInto(method string, methodArgs map[string]interface{}, obj interface{}) (err error)

func (*Client) CloudServerCreate added in v0.6.1

func (ci *Client) CloudServerCreate(params *CloudServerCreateParams) (string, error)

func (*Client) CloudServerResize added in v0.6.5

func (self *Client) CloudServerResize(params *CloudServerResizeParams) (result string, err error)

func (*Client) CloudTemplateRestore added in v0.6.1

func (ci *Client) CloudTemplateRestore(params *CloudTemplateRestoreParams) (string, error)

func (*Client) DerivePrivateParentUniqId added in v0.6.1

func (ci *Client) DerivePrivateParentUniqId(name string) (uniqId string, zone int64, privateParentDetailsErr error)

func (*Client) Die

func (*Client) Die(err error)

func (*Client) JsonEncodeAndPrettyPrint

func (*Client) JsonEncodeAndPrettyPrint(data interface{}) (string, error)

func (*Client) JsonPrettyPrint

func (*Client) JsonPrettyPrint(inJson string) (string, error)

func (*Client) ProcessPlan added in v0.6.1

func (ci *Client) ProcessPlan(plan *Plan) error

func (*Client) RemoveContext

func (client *Client) RemoveContext(context string) error

func (*Client) Ssh added in v0.6.8

func (self *Client) Ssh(params *SshParams) (err error)

type CloudServerCreateParams added in v0.6.1

type CloudServerCreateParams struct {
	Template      string   `yaml:"template"`
	Type          string   `yaml:"type"`
	Hostname      string   `yaml:"hostname"`
	Ips           int      `yaml:"ips"`
	PoolIps       []string `yaml:"pool-ips"`
	PublicSshKey  string   `yaml:"public-ssh-key"`
	ConfigId      int      `yaml:"config-id"`
	BackupDays    int      `yaml:"backup-days"`  // daily backup plan; how many days to keep a backup
	BackupQuota   int      `yaml:"backup-quota"` // backup quota plan; how many gb of backups to keep
	Bandwidth     string   `yaml:"bandwidth"`
	Zone          int64    `yaml:"zone"`
	WinAv         string   `yaml:"winav"`  // windows
	MsSql         string   `yaml:"ms-sql"` // windows
	PrivateParent string   `yaml:"private-parent"`
	Password      string   `yaml:"password"`
	Memory        int      `yaml:"memory"`    // required only if private parent
	Diskspace     int      `yaml:"diskspace"` // required only if private parent
	Vcpu          int      `yaml:"vcpu"`      // required only if private parent
	BackupId      int      `yaml:"backup-id"` //create from backup
	ImageId       int      `yaml:"image-id"`  // create from image
}

func (*CloudServerCreateParams) UnmarshalYAML added in v0.6.1

func (s *CloudServerCreateParams) UnmarshalYAML(unmarshal func(interface{}) error) error

type CloudServerResizeParams added in v0.6.5

type CloudServerResizeParams struct {
	UniqId        string `yaml:"uniq-id"`
	ConfigId      int64  `yaml:"config-id"`
	SkipFsResize  bool   `yaml:"skip-fs-resize"`
	PrivateParent string `yaml:"private-parent"`
	Memory        int64  `yaml:"memory"`
	Vcpu          int64  `yaml:"vcpu"`
	DiskSpace     int64  `yaml:"disk-space"`
}

func (*CloudServerResizeParams) UnmarshalYAML added in v0.6.5

func (self *CloudServerResizeParams) UnmarshalYAML(unmarshal func(interface{}) error) error

type CloudTemplateRestoreParams added in v0.6.1

type CloudTemplateRestoreParams struct {
	Template string `yaml:"template"`
	UniqId   string `yaml:"uniq-id"`
}

type Plan added in v0.6.1

type Plan struct {
	Cloud *PlanCloud
	Ssh   []SshParams
}

type PlanCloud added in v0.6.1

type PlanCloud struct {
	Server   *PlanCloudServer
	Template *PlanCloudTemplate
}

type PlanCloudServer added in v0.6.1

type PlanCloudServer struct {
	Create []CloudServerCreateParams
	Resize []CloudServerResizeParams
}

type PlanCloudTemplate added in v0.6.1

type PlanCloudTemplate struct {
	Restore []CloudTemplateRestoreParams
}

type SshParams added in v0.6.8

type SshParams struct {
	Host            string `yaml:"host"`
	Port            int    `yaml:"port"`
	PrivateKeyFile  string `yaml:"private-key-file"`
	User            string `yaml:"user"`
	AgentForwarding bool   `yaml:"agent-forwarding"`
	Command         string `yaml:"command"`
}

func (*SshParams) TranslateHost added in v0.6.8

func (self *SshParams) TranslateHost(ci *Client) (ip string, err error)

func (*SshParams) UnmarshalYAML added in v0.6.8

func (self *SshParams) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL