Merge pull request #7294 from hyperonecom/hyperone
Add HyperOne builder
This commit is contained in:
commit
05897c8653
@ -16,6 +16,7 @@
|
||||
/builder/ncloud/ @YuSungDuk
|
||||
/builder/scaleway/ @sieben @mvaude @jqueuniet @fflorens @brmzkw
|
||||
/builder/hcloud/ @LKaemmerling
|
||||
/builder/hyperone @m110 @gregorybrzeski @ad-m
|
||||
|
||||
# provisioners
|
||||
|
||||
|
48
builder/hyperone/artifact.go
Normal file
48
builder/hyperone/artifact.go
Normal file
@ -0,0 +1,48 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type Artifact struct {
|
||||
imageName string
|
||||
imageID string
|
||||
client *openapi.APIClient
|
||||
}
|
||||
|
||||
func (a *Artifact) BuilderId() string {
|
||||
return BuilderID
|
||||
}
|
||||
|
||||
func (a *Artifact) Files() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *Artifact) Id() string {
|
||||
return a.imageID
|
||||
}
|
||||
|
||||
func (a *Artifact) String() string {
|
||||
return fmt.Sprintf("Image '%s' created, ID: %s", a.imageName, a.imageID)
|
||||
}
|
||||
|
||||
func (a *Artifact) State(name string) interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *Artifact) Destroy() error {
|
||||
if a.imageID == "" {
|
||||
// No image to destroy
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := a.client.ImageApi.ImageDelete(context.TODO(), a.imageID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
120
builder/hyperone/builder.go
Normal file
120
builder/hyperone/builder.go
Normal file
@ -0,0 +1,120 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/hashicorp/packer/common"
|
||||
"github.com/hashicorp/packer/helper/communicator"
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hashicorp/packer/template/interpolate"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
const BuilderID = "hyperone.builder"
|
||||
|
||||
type Builder struct {
|
||||
config Config
|
||||
runner multistep.Runner
|
||||
client *openapi.APIClient
|
||||
}
|
||||
|
||||
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||
config, warnings, errs := NewConfig(raws...)
|
||||
if errs != nil {
|
||||
return warnings, errs
|
||||
}
|
||||
|
||||
b.config = *config
|
||||
|
||||
cfg := openapi.NewConfiguration()
|
||||
cfg.AddDefaultHeader("x-auth-token", b.config.Token)
|
||||
if b.config.Project != "" {
|
||||
cfg.AddDefaultHeader("x-project", b.config.Project)
|
||||
}
|
||||
|
||||
if b.config.APIURL != "" {
|
||||
cfg.BasePath = b.config.APIURL
|
||||
}
|
||||
|
||||
prefer := fmt.Sprintf("respond-async,wait=%d", int(b.config.StateTimeout.Seconds()))
|
||||
cfg.AddDefaultHeader("Prefer", prefer)
|
||||
|
||||
b.client = openapi.NewAPIClient(cfg)
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
type wrappedCommandTemplate struct {
|
||||
Command string
|
||||
}
|
||||
|
||||
func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) {
|
||||
wrappedCommand := func(command string) (string, error) {
|
||||
ctx := b.config.ctx
|
||||
ctx.Data = &wrappedCommandTemplate{Command: command}
|
||||
return interpolate.Render(b.config.ChrootCommandWrapper, &ctx)
|
||||
}
|
||||
|
||||
state := &multistep.BasicStateBag{}
|
||||
state.Put("config", &b.config)
|
||||
state.Put("client", b.client)
|
||||
state.Put("hook", hook)
|
||||
state.Put("ui", ui)
|
||||
state.Put("wrappedCommand", CommandWrapper(wrappedCommand))
|
||||
|
||||
steps := []multistep.Step{
|
||||
&stepCreateSSHKey{},
|
||||
&stepCreateVM{},
|
||||
&communicator.StepConnect{
|
||||
Config: &b.config.Comm,
|
||||
Host: getPublicIP,
|
||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||
},
|
||||
}
|
||||
|
||||
if b.config.ChrootDisk {
|
||||
steps = append(steps,
|
||||
&stepPrepareDevice{},
|
||||
&stepPreMountCommands{},
|
||||
&stepMountChroot{},
|
||||
&stepPostMountCommands{},
|
||||
&stepMountExtra{},
|
||||
&stepCopyFiles{},
|
||||
&stepChrootProvision{},
|
||||
&stepStopVM{},
|
||||
&stepDetachDisk{},
|
||||
&stepCreateVMFromDisk{},
|
||||
&stepCreateImage{},
|
||||
)
|
||||
} else {
|
||||
steps = append(steps,
|
||||
&common.StepProvision{},
|
||||
&stepStopVM{},
|
||||
&stepCreateImage{},
|
||||
)
|
||||
}
|
||||
|
||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
||||
b.runner.Run(state)
|
||||
|
||||
if rawErr, ok := state.GetOk("error"); ok {
|
||||
return nil, rawErr.(error)
|
||||
}
|
||||
|
||||
artifact := &Artifact{
|
||||
imageID: state.Get("image_id").(string),
|
||||
imageName: state.Get("image_name").(string),
|
||||
client: b.client,
|
||||
}
|
||||
|
||||
return artifact, nil
|
||||
}
|
||||
|
||||
func (b *Builder) Cancel() {
|
||||
if b.runner != nil {
|
||||
log.Println("Cancelling the runner...")
|
||||
b.runner.Cancel()
|
||||
}
|
||||
}
|
63
builder/hyperone/builder_acc_test.go
Normal file
63
builder/hyperone/builder_acc_test.go
Normal file
@ -0,0 +1,63 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
builderT "github.com/hashicorp/packer/helper/builder/testing"
|
||||
)
|
||||
|
||||
func TestBuilderAcc_basic(t *testing.T) {
|
||||
builderT.Test(t, builderT.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Builder: &Builder{},
|
||||
Template: testBuilderAccBasic,
|
||||
})
|
||||
}
|
||||
|
||||
func TestBuilderAcc_chroot(t *testing.T) {
|
||||
builderT.Test(t, builderT.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Builder: &Builder{},
|
||||
Template: testBuilderAccChroot,
|
||||
})
|
||||
}
|
||||
|
||||
func testAccPreCheck(t *testing.T) {
|
||||
if v := os.Getenv("HYPERONE_TOKEN"); v == "" {
|
||||
t.Fatal("HYPERONE_TOKEN must be set for acceptance tests")
|
||||
}
|
||||
}
|
||||
|
||||
const testBuilderAccBasic = `
|
||||
{
|
||||
"builders": [{
|
||||
"type": "test",
|
||||
"vm_type": "a1.nano",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10
|
||||
}]
|
||||
}
|
||||
`
|
||||
|
||||
const testBuilderAccChroot = `
|
||||
{
|
||||
"builders": [{
|
||||
"type": "test",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10,
|
||||
"vm_type": "a1.nano",
|
||||
"chroot_disk": true,
|
||||
"chroot_command_wrapper": "sudo {{.Command}}",
|
||||
"pre_mount_commands": [
|
||||
"parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print",
|
||||
"mkfs.ext4 {{.Device}}1"
|
||||
],
|
||||
"post_mount_commands": [
|
||||
"apt-get update",
|
||||
"apt-get install debootstrap",
|
||||
"debootstrap --arch amd64 bionic {{.MountPath}}"
|
||||
]
|
||||
}]
|
||||
}
|
||||
`
|
54
builder/hyperone/chroot_communicator.go
Normal file
54
builder/hyperone/chroot_communicator.go
Normal file
@ -0,0 +1,54 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type CommandWrapper func(string) (string, error)
|
||||
|
||||
// ChrootCommunicator works as a wrapper on SSHCommunicator, modyfing paths in
|
||||
// flight to be run in a chroot.
|
||||
type ChrootCommunicator struct {
|
||||
Chroot string
|
||||
CmdWrapper CommandWrapper
|
||||
Wrapped packer.Communicator
|
||||
}
|
||||
|
||||
func (c *ChrootCommunicator) Start(cmd *packer.RemoteCmd) error {
|
||||
command := strconv.Quote(cmd.Command)
|
||||
chrootCommand, err := c.CmdWrapper(
|
||||
fmt.Sprintf("sudo chroot %s /bin/sh -c %s", c.Chroot, command))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.Command = chrootCommand
|
||||
|
||||
return c.Wrapped.Start(cmd)
|
||||
}
|
||||
|
||||
func (c *ChrootCommunicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error {
|
||||
dst = filepath.Join(c.Chroot, dst)
|
||||
return c.Wrapped.Upload(dst, r, fi)
|
||||
}
|
||||
|
||||
func (c *ChrootCommunicator) UploadDir(dst string, src string, exclude []string) error {
|
||||
dst = filepath.Join(c.Chroot, dst)
|
||||
return c.Wrapped.UploadDir(dst, src, exclude)
|
||||
}
|
||||
|
||||
func (c *ChrootCommunicator) Download(src string, w io.Writer) error {
|
||||
src = filepath.Join(c.Chroot, src)
|
||||
return c.Wrapped.Download(src, w)
|
||||
}
|
||||
|
||||
func (c *ChrootCommunicator) DownloadDir(src string, dst string, exclude []string) error {
|
||||
src = filepath.Join(c.Chroot, src)
|
||||
return c.Wrapped.DownloadDir(src, dst, exclude)
|
||||
}
|
293
builder/hyperone/config.go
Normal file
293
builder/hyperone/config.go
Normal file
@ -0,0 +1,293 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/packer/common"
|
||||
"github.com/hashicorp/packer/common/json"
|
||||
"github.com/hashicorp/packer/common/uuid"
|
||||
"github.com/hashicorp/packer/helper/communicator"
|
||||
"github.com/hashicorp/packer/helper/config"
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hashicorp/packer/template/interpolate"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
const (
|
||||
configPath = "~/.h1-cli/conf.json"
|
||||
tokenEnv = "HYPERONE_TOKEN"
|
||||
|
||||
defaultDiskType = "ssd"
|
||||
defaultImageService = "564639bc052c084e2f2e3266"
|
||||
defaultStateTimeout = 5 * time.Minute
|
||||
defaultUserName = "guru"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
common.PackerConfig `mapstructure:",squash"`
|
||||
Comm communicator.Config `mapstructure:",squash"`
|
||||
|
||||
APIURL string `mapstructure:"api_url"`
|
||||
Token string `mapstructure:"token"`
|
||||
Project string `mapstructure:"project"`
|
||||
TokenLogin string `mapstructure:"token_login"`
|
||||
|
||||
StateTimeout time.Duration `mapstructure:"state_timeout"`
|
||||
|
||||
SourceImage string `mapstructure:"source_image"`
|
||||
ImageName string `mapstructure:"image_name"`
|
||||
ImageDescription string `mapstructure:"image_description"`
|
||||
ImageTags map[string]interface{} `mapstructure:"image_tags"`
|
||||
ImageService string `mapstructure:"image_service"`
|
||||
|
||||
VmType string `mapstructure:"vm_type"`
|
||||
VmName string `mapstructure:"vm_name"`
|
||||
VmTags map[string]interface{} `mapstructure:"vm_tags"`
|
||||
|
||||
DiskName string `mapstructure:"disk_name"`
|
||||
DiskType string `mapstructure:"disk_type"`
|
||||
DiskSize float32 `mapstructure:"disk_size"`
|
||||
|
||||
Network string `mapstructure:"network"`
|
||||
PrivateIP string `mapstructure:"private_ip"`
|
||||
PublicIP string `mapstructure:"public_ip"`
|
||||
PublicNetAdpService string `mapstructure:"public_netadp_service"`
|
||||
|
||||
ChrootDisk bool `mapstructure:"chroot_disk"`
|
||||
ChrootDiskSize float32 `mapstructure:"chroot_disk_size"`
|
||||
ChrootDiskType string `mapstructure:"chroot_disk_type"`
|
||||
ChrootMountPath string `mapstructure:"chroot_mount_path"`
|
||||
ChrootMounts [][]string `mapstructure:"chroot_mounts"`
|
||||
ChrootCopyFiles []string `mapstructure:"chroot_copy_files"`
|
||||
ChrootCommandWrapper string `mapstructure:"chroot_command_wrapper"`
|
||||
|
||||
MountOptions []string `mapstructure:"mount_options"`
|
||||
MountPartition string `mapstructure:"mount_partition"`
|
||||
PreMountCommands []string `mapstructure:"pre_mount_commands"`
|
||||
PostMountCommands []string `mapstructure:"post_mount_commands"`
|
||||
|
||||
SSHKeys []string `mapstructure:"ssh_keys"`
|
||||
UserData string `mapstructure:"user_data"`
|
||||
|
||||
ctx interpolate.Context
|
||||
}
|
||||
|
||||
func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
||||
c := &Config{}
|
||||
|
||||
var md mapstructure.Metadata
|
||||
err := config.Decode(c, &config.DecodeOpts{
|
||||
Metadata: &md,
|
||||
Interpolate: true,
|
||||
InterpolateContext: &c.ctx,
|
||||
InterpolateFilter: &interpolate.RenderFilter{
|
||||
Exclude: []string{
|
||||
"run_command",
|
||||
"chroot_command_wrapper",
|
||||
"post_mount_commands",
|
||||
"pre_mount_commands",
|
||||
"mount_path",
|
||||
},
|
||||
},
|
||||
}, raws...)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cliConfig, err := loadCLIConfig()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// Defaults
|
||||
if c.Comm.SSHUsername == "" {
|
||||
c.Comm.SSHUsername = defaultUserName
|
||||
}
|
||||
|
||||
if c.Comm.SSHTimeout == 0 {
|
||||
c.Comm.SSHTimeout = 10 * time.Minute
|
||||
}
|
||||
|
||||
if c.APIURL == "" {
|
||||
c.APIURL = os.Getenv("HYPERONE_API_URL")
|
||||
}
|
||||
|
||||
if c.Token == "" {
|
||||
c.Token = os.Getenv(tokenEnv)
|
||||
|
||||
if c.Token == "" {
|
||||
c.Token = cliConfig.Profile.APIKey
|
||||
}
|
||||
|
||||
// Fetching token by SSH is available only for the default API endpoint
|
||||
if c.TokenLogin != "" && c.APIURL == "" {
|
||||
c.Token, err = fetchTokenBySSH(c.TokenLogin)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if c.Project == "" {
|
||||
c.Project = cliConfig.Profile.Project.ID
|
||||
}
|
||||
|
||||
if c.StateTimeout == 0 {
|
||||
c.StateTimeout = defaultStateTimeout
|
||||
}
|
||||
|
||||
if c.ImageName == "" {
|
||||
name, err := interpolate.Render("packer-{{timestamp}}", nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
c.ImageName = name
|
||||
}
|
||||
|
||||
if c.ImageService == "" {
|
||||
c.ImageService = defaultImageService
|
||||
}
|
||||
|
||||
if c.VmName == "" {
|
||||
c.VmName = fmt.Sprintf("packer-%s", uuid.TimeOrderedUUID())
|
||||
}
|
||||
|
||||
if c.DiskType == "" {
|
||||
c.DiskType = defaultDiskType
|
||||
}
|
||||
|
||||
if c.PublicNetAdpService == "" {
|
||||
c.PublicNetAdpService = "public"
|
||||
}
|
||||
|
||||
if c.ChrootCommandWrapper == "" {
|
||||
c.ChrootCommandWrapper = "{{.Command}}"
|
||||
}
|
||||
|
||||
if c.ChrootDiskSize == 0 {
|
||||
c.ChrootDiskSize = c.DiskSize
|
||||
}
|
||||
|
||||
if c.ChrootDiskType == "" {
|
||||
c.ChrootDiskType = c.DiskType
|
||||
}
|
||||
|
||||
if c.ChrootMountPath == "" {
|
||||
path, err := interpolate.Render("/mnt/packer-hyperone-volumes/{{timestamp}}", nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
c.ChrootMountPath = path
|
||||
}
|
||||
|
||||
if c.ChrootMounts == nil {
|
||||
c.ChrootMounts = make([][]string, 0)
|
||||
}
|
||||
|
||||
if len(c.ChrootMounts) == 0 {
|
||||
c.ChrootMounts = [][]string{
|
||||
{"proc", "proc", "/proc"},
|
||||
{"sysfs", "sysfs", "/sys"},
|
||||
{"bind", "/dev", "/dev"},
|
||||
{"devpts", "devpts", "/dev/pts"},
|
||||
{"binfmt_misc", "binfmt_misc", "/proc/sys/fs/binfmt_misc"},
|
||||
}
|
||||
}
|
||||
|
||||
if c.ChrootCopyFiles == nil {
|
||||
c.ChrootCopyFiles = []string{"/etc/resolv.conf"}
|
||||
}
|
||||
|
||||
if c.MountPartition == "" {
|
||||
c.MountPartition = "1"
|
||||
}
|
||||
|
||||
// Validation
|
||||
var errs *packer.MultiError
|
||||
if es := c.Comm.Prepare(&c.ctx); len(es) > 0 {
|
||||
errs = packer.MultiErrorAppend(errs, es...)
|
||||
}
|
||||
|
||||
if c.Token == "" {
|
||||
errs = packer.MultiErrorAppend(errs, errors.New("token is required"))
|
||||
}
|
||||
|
||||
if c.VmType == "" {
|
||||
errs = packer.MultiErrorAppend(errs, errors.New("vm type is required"))
|
||||
}
|
||||
|
||||
if c.DiskSize == 0 {
|
||||
errs = packer.MultiErrorAppend(errs, errors.New("disk size is required"))
|
||||
}
|
||||
|
||||
if c.SourceImage == "" {
|
||||
errs = packer.MultiErrorAppend(errs, errors.New("source image is required"))
|
||||
}
|
||||
|
||||
if c.ChrootDisk {
|
||||
if len(c.PreMountCommands) == 0 {
|
||||
errs = packer.MultiErrorAppend(errs, errors.New("pre-mount commands are required for chroot disk"))
|
||||
}
|
||||
}
|
||||
|
||||
for _, mounts := range c.ChrootMounts {
|
||||
if len(mounts) != 3 {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, errors.New("each chroot_mounts entry should have three elements"))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if errs != nil && len(errs.Errors) > 0 {
|
||||
return nil, nil, errs
|
||||
}
|
||||
|
||||
packer.LogSecretFilter.Set(c.Token)
|
||||
|
||||
return c, nil, nil
|
||||
}
|
||||
|
||||
type cliConfig struct {
|
||||
Profile struct {
|
||||
APIKey string `json:"apiKey"`
|
||||
Project struct {
|
||||
ID string `json:"_id"`
|
||||
} `json:"project"`
|
||||
} `json:"profile"`
|
||||
}
|
||||
|
||||
func loadCLIConfig() (cliConfig, error) {
|
||||
path, err := homedir.Expand(configPath)
|
||||
if err != nil {
|
||||
return cliConfig{}, err
|
||||
}
|
||||
|
||||
_, err = os.Stat(path)
|
||||
if err != nil {
|
||||
// Config not found
|
||||
return cliConfig{}, nil
|
||||
}
|
||||
|
||||
content, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return cliConfig{}, err
|
||||
}
|
||||
|
||||
var c cliConfig
|
||||
err = json.Unmarshal(content, &c)
|
||||
if err != nil {
|
||||
return cliConfig{}, err
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func getPublicIP(state multistep.StateBag) (string, error) {
|
||||
return state.Get("public_ip").(string), nil
|
||||
}
|
28
builder/hyperone/step_chroot_provision.go
Normal file
28
builder/hyperone/step_chroot_provision.go
Normal file
@ -0,0 +1,28 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/packer/common"
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type stepChrootProvision struct{}
|
||||
|
||||
func (s *stepChrootProvision) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
wrappedCommand := state.Get("wrappedCommand").(CommandWrapper)
|
||||
sshCommunicator := state.Get("communicator").(packer.Communicator)
|
||||
|
||||
comm := &ChrootCommunicator{
|
||||
Chroot: config.ChrootMountPath,
|
||||
CmdWrapper: wrappedCommand,
|
||||
Wrapped: sshCommunicator,
|
||||
}
|
||||
|
||||
stepProvision := common.StepProvision{Comm: comm}
|
||||
return stepProvision.Run(ctx, state)
|
||||
}
|
||||
|
||||
func (s *stepChrootProvision) Cleanup(multistep.StateBag) {}
|
40
builder/hyperone/step_copy_files.go
Normal file
40
builder/hyperone/step_copy_files.go
Normal file
@ -0,0 +1,40 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type stepCopyFiles struct{}
|
||||
|
||||
func (s *stepCopyFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
if len(config.ChrootCopyFiles) == 0 {
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
ui.Say("Copying files from host to chroot...")
|
||||
for _, path := range config.ChrootCopyFiles {
|
||||
chrootPath := filepath.Join(config.ChrootMountPath, path)
|
||||
log.Printf("Copying '%s' to '%s'", path, chrootPath)
|
||||
|
||||
command := fmt.Sprintf("cp --remove-destination %s %s", path, chrootPath)
|
||||
err := runCommands([]string{command}, config.ctx, state)
|
||||
if err != nil {
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepCopyFiles) Cleanup(state multistep.StateBag) {}
|
65
builder/hyperone/step_create_image.go
Normal file
65
builder/hyperone/step_create_image.go
Normal file
@ -0,0 +1,65 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type stepCreateImage struct {
|
||||
imageID string
|
||||
}
|
||||
|
||||
func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
vmID := state.Get("vm_id").(string)
|
||||
|
||||
ui.Say("Creating image...")
|
||||
|
||||
image, _, err := client.ImageApi.ImageCreate(ctx, openapi.ImageCreate{
|
||||
Name: config.ImageName,
|
||||
Vm: vmID,
|
||||
Service: config.ImageService,
|
||||
Description: config.ImageDescription,
|
||||
Tag: config.ImageTags,
|
||||
})
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error creating image: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
s.imageID = image.Id
|
||||
|
||||
state.Put("image_id", image.Id)
|
||||
state.Put("image_name", image.Name)
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepCreateImage) Cleanup(state multistep.StateBag) {
|
||||
if s.imageID == "" {
|
||||
return
|
||||
}
|
||||
|
||||
_, cancelled := state.GetOk(multistep.StateCancelled)
|
||||
_, halted := state.GetOk(multistep.StateHalted)
|
||||
if !cancelled && !halted {
|
||||
return
|
||||
}
|
||||
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
_, err := client.ImageApi.ImageDelete(context.TODO(), s.imageID)
|
||||
if err != nil {
|
||||
ui.Error(fmt.Sprintf("error deleting image '%s' - consider deleting it manually: %s",
|
||||
s.imageID, formatOpenAPIError(err)))
|
||||
}
|
||||
}
|
82
builder/hyperone/step_create_ssh_key.go
Normal file
82
builder/hyperone/step_create_ssh_key.go
Normal file
@ -0,0 +1,82 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
type stepCreateSSHKey struct {
|
||||
Debug bool
|
||||
DebugKeyPath string
|
||||
}
|
||||
|
||||
func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
c := state.Get("config").(*Config)
|
||||
ui.Say("Creating a temporary ssh key for the VM...")
|
||||
|
||||
priv, err := rsa.GenerateKey(rand.Reader, 2048)
|
||||
if err != nil {
|
||||
state.Put("error", fmt.Errorf("error generating ssh key: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
privDER := x509.MarshalPKCS1PrivateKey(priv)
|
||||
privBLK := pem.Block{
|
||||
Type: "RSA PRIVATE KEY",
|
||||
Headers: nil,
|
||||
Bytes: privDER,
|
||||
}
|
||||
|
||||
c.Comm.SSHPrivateKey = pem.EncodeToMemory(&privBLK)
|
||||
|
||||
pub, err := ssh.NewPublicKey(&priv.PublicKey)
|
||||
if err != nil {
|
||||
state.Put("error", fmt.Errorf("error getting public key: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
pubSSHFormat := string(ssh.MarshalAuthorizedKey(pub))
|
||||
|
||||
// Remember public SSH key for future connections
|
||||
state.Put("ssh_public_key", pubSSHFormat)
|
||||
|
||||
// If we're in debug mode, output the private key to the working directory.
|
||||
if s.Debug {
|
||||
ui.Message(fmt.Sprintf("Saving key for debug purposes: %s", s.DebugKeyPath))
|
||||
f, err := os.Create(s.DebugKeyPath)
|
||||
if err != nil {
|
||||
state.Put("error", fmt.Errorf("error saving debug key: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
// Write the key out
|
||||
if _, err := f.Write(pem.EncodeToMemory(&privBLK)); err != nil {
|
||||
state.Put("error", fmt.Errorf("error saving debug key: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
// Chmod it so that it is SSH ready
|
||||
if runtime.GOOS != "windows" {
|
||||
if err := f.Chmod(0600); err != nil {
|
||||
state.Put("error", fmt.Errorf("error setting permissions of debug key: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepCreateSSHKey) Cleanup(state multistep.StateBag) {}
|
199
builder/hyperone/step_create_vm.go
Normal file
199
builder/hyperone/step_create_vm.go
Normal file
@ -0,0 +1,199 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type stepCreateVM struct {
|
||||
vmID string
|
||||
}
|
||||
|
||||
const (
|
||||
chrootDiskName = "packer-chroot-disk"
|
||||
)
|
||||
|
||||
func (s *stepCreateVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
sshKey := state.Get("ssh_public_key").(string)
|
||||
|
||||
ui.Say("Creating VM...")
|
||||
|
||||
netAdapter := pickNetAdapter(config)
|
||||
|
||||
var sshKeys = []string{sshKey}
|
||||
sshKeys = append(sshKeys, config.SSHKeys...)
|
||||
|
||||
disks := []openapi.VmCreateDisk{
|
||||
{
|
||||
Service: config.DiskType,
|
||||
Size: config.DiskSize,
|
||||
},
|
||||
}
|
||||
|
||||
if config.ChrootDisk {
|
||||
disks = append(disks, openapi.VmCreateDisk{
|
||||
Service: config.ChrootDiskType,
|
||||
Size: config.ChrootDiskSize,
|
||||
Name: chrootDiskName,
|
||||
})
|
||||
}
|
||||
|
||||
options := openapi.VmCreate{
|
||||
Name: config.VmName,
|
||||
Image: config.SourceImage,
|
||||
Service: config.VmType,
|
||||
SshKeys: sshKeys,
|
||||
Disk: disks,
|
||||
Netadp: []openapi.VmCreateNetadp{netAdapter},
|
||||
UserMetadata: config.UserData,
|
||||
Tag: config.VmTags,
|
||||
}
|
||||
|
||||
vm, _, err := client.VmApi.VmCreate(ctx, options)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error creating VM: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
s.vmID = vm.Id
|
||||
state.Put("vm_id", vm.Id)
|
||||
|
||||
hdds, _, err := client.VmApi.VmListHdd(ctx, vm.Id)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error listing hdd: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
for _, hdd := range hdds {
|
||||
if hdd.Disk.Name == chrootDiskName {
|
||||
state.Put("chroot_disk_id", hdd.Disk.Id)
|
||||
controllerNumber := strings.ToLower(strings.Trim(hdd.ControllerNumber, "{}"))
|
||||
state.Put("chroot_controller_number", controllerNumber)
|
||||
state.Put("chroot_controller_location", int(hdd.ControllerLocation))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
netadp, _, err := client.VmApi.VmListNetadp(ctx, vm.Id)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error listing netadp: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
if len(netadp) < 1 {
|
||||
err := fmt.Errorf("no network adapters found")
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
publicIP, err := associatePublicIP(ctx, config, client, netadp[0])
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error associating IP: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
state.Put("public_ip", publicIP)
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func pickNetAdapter(config *Config) openapi.VmCreateNetadp {
|
||||
if config.Network == "" {
|
||||
if config.PublicIP != "" {
|
||||
return openapi.VmCreateNetadp{
|
||||
Service: config.PublicNetAdpService,
|
||||
Ip: []string{config.PublicIP},
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var privateIPs []string
|
||||
|
||||
if config.PrivateIP == "" {
|
||||
privateIPs = nil
|
||||
} else {
|
||||
privateIPs = []string{config.PrivateIP}
|
||||
}
|
||||
|
||||
return openapi.VmCreateNetadp{
|
||||
Service: "private",
|
||||
Network: config.Network,
|
||||
Ip: privateIPs,
|
||||
}
|
||||
}
|
||||
|
||||
return openapi.VmCreateNetadp{
|
||||
Service: config.PublicNetAdpService,
|
||||
}
|
||||
}
|
||||
|
||||
func associatePublicIP(ctx context.Context, config *Config, client *openapi.APIClient, netadp openapi.Netadp) (string, error) {
|
||||
if config.Network == "" || config.PublicIP == "" {
|
||||
// Public IP belongs to attached net adapter
|
||||
return netadp.Ip[0].Address, nil
|
||||
}
|
||||
|
||||
var privateIP string
|
||||
if config.PrivateIP == "" {
|
||||
privateIP = netadp.Ip[0].Id
|
||||
} else {
|
||||
privateIP = config.PrivateIP
|
||||
}
|
||||
|
||||
ip, _, err := client.IpApi.IpActionAssociate(ctx, config.PublicIP, openapi.IpActionAssociate{Ip: privateIP})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return ip.Address, nil
|
||||
}
|
||||
|
||||
func (s *stepCreateVM) Cleanup(state multistep.StateBag) {
|
||||
if s.vmID == "" {
|
||||
return
|
||||
}
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
ui.Say(fmt.Sprintf("Deleting VM %s...", s.vmID))
|
||||
err := deleteVMWithDisks(s.vmID, state)
|
||||
if err != nil {
|
||||
ui.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func deleteVMWithDisks(vmID string, state multistep.StateBag) error {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
hdds, _, err := client.VmApi.VmListHdd(context.TODO(), vmID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing hdd: %s", formatOpenAPIError(err))
|
||||
}
|
||||
|
||||
deleteOptions := openapi.VmDelete{}
|
||||
for _, hdd := range hdds {
|
||||
deleteOptions.RemoveDisks = append(deleteOptions.RemoveDisks, hdd.Disk.Id)
|
||||
}
|
||||
|
||||
_, err = client.VmApi.VmDelete(context.TODO(), vmID, deleteOptions)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error deleting server '%s' - please delete it manually: %s", vmID, formatOpenAPIError(err))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
63
builder/hyperone/step_create_vm_from_disk.go
Normal file
63
builder/hyperone/step_create_vm_from_disk.go
Normal file
@ -0,0 +1,63 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type stepCreateVMFromDisk struct {
|
||||
vmID string
|
||||
}
|
||||
|
||||
func (s *stepCreateVMFromDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
config := state.Get("config").(*Config)
|
||||
sshKey := state.Get("ssh_public_key").(string)
|
||||
chrootDiskID := state.Get("chroot_disk_id").(string)
|
||||
|
||||
ui.Say("Creating VM from disk...")
|
||||
|
||||
options := openapi.VmCreate{
|
||||
Name: config.VmName,
|
||||
Service: config.VmType,
|
||||
Disk: []openapi.VmCreateDisk{
|
||||
{
|
||||
Id: chrootDiskID,
|
||||
},
|
||||
},
|
||||
SshKeys: []string{sshKey},
|
||||
Boot: false,
|
||||
}
|
||||
|
||||
vm, _, err := client.VmApi.VmCreate(ctx, options)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error creating VM from disk: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
s.vmID = vm.Id
|
||||
state.Put("vm_id", vm.Id)
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepCreateVMFromDisk) Cleanup(state multistep.StateBag) {
|
||||
if s.vmID == "" {
|
||||
return
|
||||
}
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
ui.Say(fmt.Sprintf("Deleting VM %s (from chroot disk)...", s.vmID))
|
||||
err := deleteVMWithDisks(s.vmID, state)
|
||||
if err != nil {
|
||||
ui.Error(err.Error())
|
||||
}
|
||||
}
|
116
builder/hyperone/step_create_vm_test.go
Normal file
116
builder/hyperone/step_create_vm_test.go
Normal file
@ -0,0 +1,116 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestPickNetAdapter(t *testing.T) {
|
||||
cases := []struct {
|
||||
Name string
|
||||
Config Config
|
||||
Expected openapi.VmCreateNetadp
|
||||
}{
|
||||
{
|
||||
Name: "no_network",
|
||||
Config: Config{
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "public",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "no_network_public_ip",
|
||||
Config: Config{
|
||||
PublicIP: "some-public-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "public",
|
||||
Ip: []string{"some-public-ip"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "no_network_private_ip",
|
||||
Config: Config{
|
||||
PrivateIP: "some-private-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "public",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "no_network_both_ip",
|
||||
Config: Config{
|
||||
PublicIP: "some-public-ip",
|
||||
PrivateIP: "some-private-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "public",
|
||||
Ip: []string{"some-public-ip"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "network_no_ip",
|
||||
Config: Config{
|
||||
Network: "some-network",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "private",
|
||||
Network: "some-network",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "network_public_ip",
|
||||
Config: Config{
|
||||
Network: "some-network",
|
||||
PublicIP: "some-public-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "private",
|
||||
Network: "some-network",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "network_private_ip",
|
||||
Config: Config{
|
||||
Network: "some-network",
|
||||
PrivateIP: "some-private-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "private",
|
||||
Network: "some-network",
|
||||
Ip: []string{"some-private-ip"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "network_both_ip",
|
||||
Config: Config{
|
||||
Network: "some-network",
|
||||
PublicIP: "some-public-ip",
|
||||
PrivateIP: "some-private-ip",
|
||||
PublicNetAdpService: "public",
|
||||
},
|
||||
Expected: openapi.VmCreateNetadp{
|
||||
Service: "private",
|
||||
Network: "some-network",
|
||||
Ip: []string{"some-private-ip"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
t.Run(c.Name, func(t *testing.T) {
|
||||
result := pickNetAdapter(&c.Config)
|
||||
assert.Equal(t, c.Expected, result)
|
||||
})
|
||||
}
|
||||
}
|
34
builder/hyperone/step_detach_disk.go
Normal file
34
builder/hyperone/step_detach_disk.go
Normal file
@ -0,0 +1,34 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type stepDetachDisk struct {
|
||||
vmID string
|
||||
}
|
||||
|
||||
func (s *stepDetachDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
vmID := state.Get("vm_id").(string)
|
||||
chrootDiskID := state.Get("chroot_disk_id").(string)
|
||||
|
||||
ui.Say("Detaching chroot disk...")
|
||||
_, _, err := client.VmApi.VmDeleteHddDiskId(ctx, vmID, chrootDiskID)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error detaching disk: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepDetachDisk) Cleanup(state multistep.StateBag) {}
|
51
builder/hyperone/step_mount_chroot.go
Normal file
51
builder/hyperone/step_mount_chroot.go
Normal file
@ -0,0 +1,51 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type stepMountChroot struct{}
|
||||
|
||||
func (s *stepMountChroot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
device := state.Get("device").(string)
|
||||
|
||||
log.Printf("Mount path: %s", config.ChrootMountPath)
|
||||
|
||||
ui.Say(fmt.Sprintf("Creating mount directory: %s", config.ChrootMountPath))
|
||||
|
||||
opts := ""
|
||||
if len(config.MountOptions) > 0 {
|
||||
opts = "-o " + strings.Join(config.MountOptions, " -o ")
|
||||
}
|
||||
|
||||
deviceMount := device
|
||||
if config.MountPartition != "" {
|
||||
deviceMount = fmt.Sprintf("%s%s", device, config.MountPartition)
|
||||
}
|
||||
|
||||
commands := []string{
|
||||
fmt.Sprintf("mkdir -m 755 -p %s", config.ChrootMountPath),
|
||||
fmt.Sprintf("mount %s %s %s", opts, deviceMount, config.ChrootMountPath),
|
||||
}
|
||||
|
||||
err := runCommands(commands, config.ctx, state)
|
||||
if err != nil {
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
state.Put("mount_path", config.ChrootMountPath)
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepMountChroot) Cleanup(state multistep.StateBag) {}
|
45
builder/hyperone/step_mount_extra.go
Normal file
45
builder/hyperone/step_mount_extra.go
Normal file
@ -0,0 +1,45 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type stepMountExtra struct{}
|
||||
|
||||
func (s *stepMountExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
mountPath := state.Get("mount_path").(string)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
ui.Say("Mounting additional paths within the chroot...")
|
||||
for _, mountInfo := range config.ChrootMounts {
|
||||
innerPath := mountPath + mountInfo[2]
|
||||
|
||||
flags := "-t " + mountInfo[0]
|
||||
if mountInfo[0] == "bind" {
|
||||
flags = "--bind"
|
||||
}
|
||||
|
||||
ui.Message(fmt.Sprintf("Mounting: %s", mountInfo[2]))
|
||||
|
||||
commands := []string{
|
||||
fmt.Sprintf("mkdir -m 755 -p %s", innerPath),
|
||||
fmt.Sprintf("mount %s %s %s", flags, mountInfo[1], innerPath),
|
||||
}
|
||||
|
||||
err := runCommands(commands, config.ctx, state)
|
||||
if err != nil {
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepMountExtra) Cleanup(state multistep.StateBag) {}
|
37
builder/hyperone/step_post_mount_commands.go
Normal file
37
builder/hyperone/step_post_mount_commands.go
Normal file
@ -0,0 +1,37 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type postMountCommandsData struct {
|
||||
Device string
|
||||
MountPath string
|
||||
}
|
||||
|
||||
type stepPostMountCommands struct{}
|
||||
|
||||
func (s *stepPostMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
device := state.Get("device").(string)
|
||||
|
||||
ctx := config.ctx
|
||||
ctx.Data = &postMountCommandsData{
|
||||
Device: device,
|
||||
MountPath: config.ChrootMountPath,
|
||||
}
|
||||
|
||||
ui.Say("Running post-mount commands...")
|
||||
if err := runCommands(config.PostMountCommands, ctx, state); err != nil {
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepPostMountCommands) Cleanup(state multistep.StateBag) {}
|
37
builder/hyperone/step_pre_mount_commands.go
Normal file
37
builder/hyperone/step_pre_mount_commands.go
Normal file
@ -0,0 +1,37 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
type preMountCommandsData struct {
|
||||
Device string
|
||||
MountPath string
|
||||
}
|
||||
|
||||
type stepPreMountCommands struct{}
|
||||
|
||||
func (s *stepPreMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
config := state.Get("config").(*Config)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
device := state.Get("device").(string)
|
||||
|
||||
ctx := config.ctx
|
||||
ctx.Data = &preMountCommandsData{
|
||||
Device: device,
|
||||
MountPath: config.ChrootMountPath,
|
||||
}
|
||||
|
||||
ui.Say("Running pre-mount commands...")
|
||||
if err := runCommands(config.PreMountCommands, ctx, state); err != nil {
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepPreMountCommands) Cleanup(state multistep.StateBag) {}
|
50
builder/hyperone/step_prepare_device.go
Normal file
50
builder/hyperone/step_prepare_device.go
Normal file
@ -0,0 +1,50 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
const (
|
||||
vmBusPath = "/sys/bus/vmbus/devices"
|
||||
)
|
||||
|
||||
type stepPrepareDevice struct{}
|
||||
|
||||
func (s *stepPrepareDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
controllerNumber := state.Get("chroot_controller_number").(string)
|
||||
controllerLocation := state.Get("chroot_controller_location").(int)
|
||||
|
||||
log.Println("Searching for available device...")
|
||||
|
||||
cmd := fmt.Sprintf("find %s/%s/ -path *:%d/block -exec ls {} \\;",
|
||||
vmBusPath, controllerNumber, controllerLocation)
|
||||
|
||||
block, err := captureOutput(cmd, state)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error finding available device: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
if block == "" {
|
||||
err := fmt.Errorf("device not found")
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
device := fmt.Sprintf("/dev/%s", block)
|
||||
|
||||
ui.Say(fmt.Sprintf("Found device: %s", device))
|
||||
state.Put("device", device)
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepPrepareDevice) Cleanup(state multistep.StateBag) {}
|
32
builder/hyperone/step_stop_vm.go
Normal file
32
builder/hyperone/step_stop_vm.go
Normal file
@ -0,0 +1,32 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
type stepStopVM struct{}
|
||||
|
||||
func (s *stepStopVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||
client := state.Get("client").(*openapi.APIClient)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
vmID := state.Get("vm_id").(string)
|
||||
|
||||
ui.Say("Stopping VM...")
|
||||
|
||||
_, _, err := client.VmApi.VmActionStop(ctx, vmID)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error stopping VM: %s", formatOpenAPIError(err))
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
func (s *stepStopVM) Cleanup(multistep.StateBag) {}
|
89
builder/hyperone/token_by_ssh.go
Normal file
89
builder/hyperone/token_by_ssh.go
Normal file
@ -0,0 +1,89 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
"golang.org/x/crypto/ssh/agent"
|
||||
|
||||
"github.com/hashicorp/packer/common/json"
|
||||
)
|
||||
|
||||
const (
|
||||
sshAddress = "api.hyperone.com:22"
|
||||
sshSubsystem = "rbx-auth"
|
||||
hostKeyHash = "3e2aa423d42d7e8b14d50625512c8ac19db767ed"
|
||||
)
|
||||
|
||||
type sshData struct {
|
||||
ID string `json:"_id"`
|
||||
}
|
||||
|
||||
func sshAgent() ssh.AuthMethod {
|
||||
if sshAgent, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil {
|
||||
return ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func fetchTokenBySSH(user string) (string, error) {
|
||||
sshConfig := &ssh.ClientConfig{
|
||||
User: user,
|
||||
Auth: []ssh.AuthMethod{
|
||||
sshAgent(),
|
||||
},
|
||||
HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
|
||||
hash := sha1Sum(key)
|
||||
if hash != hostKeyHash {
|
||||
return fmt.Errorf("invalid host key hash: %s", hash)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
client, err := ssh.Dial("tcp", sshAddress, sshConfig)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
session, err := client.NewSession()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer session.Close()
|
||||
|
||||
stdout, err := session.StdoutPipe()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
err = session.RequestSubsystem(sshSubsystem)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
out, err := ioutil.ReadAll(stdout)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var data sshData
|
||||
err = json.Unmarshal(out, &data)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return data.ID, nil
|
||||
}
|
||||
|
||||
func sha1Sum(pubKey ssh.PublicKey) string {
|
||||
sum := sha1.Sum(pubKey.Marshal())
|
||||
return hex.EncodeToString(sum[:])
|
||||
}
|
86
builder/hyperone/utils.go
Normal file
86
builder/hyperone/utils.go
Normal file
@ -0,0 +1,86 @@
|
||||
package hyperone
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
"github.com/hashicorp/packer/packer"
|
||||
"github.com/hashicorp/packer/template/interpolate"
|
||||
"github.com/hyperonecom/h1-client-go"
|
||||
)
|
||||
|
||||
func formatOpenAPIError(err error) string {
|
||||
openAPIError, ok := err.(openapi.GenericOpenAPIError)
|
||||
if !ok {
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s (body: %s)", openAPIError.Error(), openAPIError.Body())
|
||||
}
|
||||
|
||||
func runCommands(commands []string, ctx interpolate.Context, state multistep.StateBag) error {
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
wrappedCommand := state.Get("wrappedCommand").(CommandWrapper)
|
||||
comm := state.Get("communicator").(packer.Communicator)
|
||||
|
||||
for _, rawCmd := range commands {
|
||||
intCmd, err := interpolate.Render(rawCmd, &ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error interpolating: %s", err)
|
||||
}
|
||||
|
||||
command, err := wrappedCommand(intCmd)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error wrapping command: %s", err)
|
||||
}
|
||||
|
||||
remoteCmd := &packer.RemoteCmd{
|
||||
Command: command,
|
||||
}
|
||||
|
||||
ui.Say(fmt.Sprintf("Executing command: %s", command))
|
||||
|
||||
err = remoteCmd.StartWithUi(comm, ui)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error running remote cmd: %s", err)
|
||||
}
|
||||
|
||||
if remoteCmd.ExitStatus != 0 {
|
||||
return fmt.Errorf(
|
||||
"received non-zero exit code %d from command: %s",
|
||||
remoteCmd.ExitStatus,
|
||||
command)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func captureOutput(command string, state multistep.StateBag) (string, error) {
|
||||
comm := state.Get("communicator").(packer.Communicator)
|
||||
|
||||
var stdout bytes.Buffer
|
||||
remoteCmd := &packer.RemoteCmd{
|
||||
Command: command,
|
||||
Stdout: &stdout,
|
||||
}
|
||||
|
||||
log.Println(fmt.Sprintf("Executing command: %s", command))
|
||||
|
||||
err := comm.Start(remoteCmd)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error running remote cmd: %s", err)
|
||||
}
|
||||
|
||||
remoteCmd.Wait()
|
||||
if remoteCmd.ExitStatus != 0 {
|
||||
return "", fmt.Errorf(
|
||||
"received non-zero exit code %d from command: %s",
|
||||
remoteCmd.ExitStatus,
|
||||
command)
|
||||
}
|
||||
|
||||
return strings.TrimSpace(stdout.String()), nil
|
||||
}
|
@ -26,6 +26,7 @@ import (
|
||||
filebuilder "github.com/hashicorp/packer/builder/file"
|
||||
googlecomputebuilder "github.com/hashicorp/packer/builder/googlecompute"
|
||||
hcloudbuilder "github.com/hashicorp/packer/builder/hcloud"
|
||||
hyperonebuilder "github.com/hashicorp/packer/builder/hyperone"
|
||||
hypervisobuilder "github.com/hashicorp/packer/builder/hyperv/iso"
|
||||
hypervvmcxbuilder "github.com/hashicorp/packer/builder/hyperv/vmcx"
|
||||
lxcbuilder "github.com/hashicorp/packer/builder/lxc"
|
||||
@ -102,6 +103,7 @@ var Builders = map[string]packer.Builder{
|
||||
"file": new(filebuilder.Builder),
|
||||
"googlecompute": new(googlecomputebuilder.Builder),
|
||||
"hcloud": new(hcloudbuilder.Builder),
|
||||
"hyperone": new(hyperonebuilder.Builder),
|
||||
"hyperv-iso": new(hypervisobuilder.Builder),
|
||||
"hyperv-vmcx": new(hypervvmcxbuilder.Builder),
|
||||
"lxc": new(lxcbuilder.Builder),
|
||||
|
25
examples/hyperone/basic.json
Normal file
25
examples/hyperone/basic.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"variables": {
|
||||
"token": "{{ env `HYPERONE_TOKEN` }}",
|
||||
"project": "{{ env `HYPERONE_PROJECT` }}"
|
||||
},
|
||||
"builders": [
|
||||
{
|
||||
"token": "{{ user `token` }}",
|
||||
"project": "{{ user `project` }}",
|
||||
"type": "hyperone",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10,
|
||||
"vm_type": "a1.nano"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"apt-get update",
|
||||
"apt-get upgrade -y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
29
examples/hyperone/chroot.json
Normal file
29
examples/hyperone/chroot.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"variables": {
|
||||
"token": "{{ env `HYPERONE_TOKEN` }}",
|
||||
"project": "{{ env `HYPERONE_PROJECT` }}"
|
||||
},
|
||||
"builders": [
|
||||
{
|
||||
"token": "{{ user `token` }}",
|
||||
"project": "{{ user `project` }}",
|
||||
"type": "hyperone",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10,
|
||||
"vm_type": "a1.nano",
|
||||
|
||||
"chroot_disk": true,
|
||||
"chroot_command_wrapper": "sudo {{.Command}}",
|
||||
"pre_mount_commands": [
|
||||
"parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print",
|
||||
"mkfs.ext4 {{.Device}}1"
|
||||
],
|
||||
"post_mount_commands": [
|
||||
"apt-get update",
|
||||
"apt-get install debootstrap",
|
||||
"debootstrap --arch amd64 bionic {{.MountPath}}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"provisioners": []
|
||||
}
|
4
go.mod
4
go.mod
@ -19,6 +19,7 @@ require (
|
||||
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f
|
||||
github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd // indirect
|
||||
github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 // indirect
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6 // indirect
|
||||
github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43
|
||||
github.com/armon/go-metrics v0.0.0-20180713145231-3c58d8115a78 // indirect
|
||||
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7 // indirect
|
||||
@ -90,6 +91,7 @@ require (
|
||||
github.com/hashicorp/vault-plugin-secrets-kv v0.0.0-20181106190520-2236f141171e // indirect
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb
|
||||
github.com/hetznercloud/hcloud-go v1.12.0
|
||||
github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775
|
||||
github.com/jefferai/jsonx v0.0.0-20160721235117-9cc31c3135ee // indirect
|
||||
github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564
|
||||
github.com/jtolds/gls v4.2.1+incompatible // indirect
|
||||
@ -114,7 +116,7 @@ require (
|
||||
github.com/mitchellh/cli v0.0.0-20170908181043-65fcae5817c8
|
||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||
github.com/mitchellh/go-fs v0.0.0-20180402234041-7b48fa161ea7
|
||||
github.com/mitchellh/go-homedir v0.0.0-20151025052427-d682a8f0cf13 // indirect
|
||||
github.com/mitchellh/go-homedir v0.0.0-20151025052427-d682a8f0cf13
|
||||
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
|
||||
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed
|
||||
github.com/mitchellh/iochan v0.0.0-20150529224432-87b45ffd0e95
|
||||
|
4
go.sum
4
go.sum
@ -36,6 +36,8 @@ github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd h1:S3Fr6QnkpW9VRjiEY
|
||||
github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
|
||||
github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 h1:BFFG6KP8ASFBg2ptWsJn8p8RDufBjBDKIxLU7BTYGOM=
|
||||
github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M=
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6 h1:uZuxRZCz65cG1o6K/xUqImNcYKtmk9ylqaH0itMSvzA=
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
|
||||
github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43 h1:ePCAQPf5tUc5IMcUvu6euhSGna7jzs7eiXtJXHig6Zc=
|
||||
github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43/go.mod h1:S6puKjZ9ZeqUPBv2hEBnMZGcM2J6mOsDRQcmxkMAND0=
|
||||
github.com/armon/go-metrics v0.0.0-20180713145231-3c58d8115a78 h1:mdRSArcFLfW0VoL34LZAKSz6LkkK4jFxVx2xYavACMg=
|
||||
@ -196,6 +198,8 @@ github.com/hetznercloud/hcloud-go v1.12.0 h1:ugZO8a8ADekqSWi7xWlcs6pxr4QE0tw5Vny
|
||||
github.com/hetznercloud/hcloud-go v1.12.0/go.mod h1:g5pff0YNAZywQaivY/CmhUYFVp7oP0nu3MiODC2W4Hw=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775 h1:MIteIoIQ5nFoOmwEHPDsqng8d0dtKj3lCnQCwGvtxXc=
|
||||
github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775/go.mod h1:R9rU87RxxmcD3DkspW9JqGBXiJyg5MA+WNCtJrBtnXs=
|
||||
github.com/jefferai/jsonx v0.0.0-20160721235117-9cc31c3135ee h1:AQ/QmCk6x8ECPpf2pkPtA4lyncEEBbs8VFnVXPYKhIs=
|
||||
github.com/jefferai/jsonx v0.0.0-20160721235117-9cc31c3135ee/go.mod h1:N0t2vlmpe8nyZB5ouIbJQPDSR+mH6oe7xHB9VZHSUzM=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
|
||||
|
@ -27,6 +27,8 @@ running on macOS, most of these are available with `brew`:
|
||||
* [gcutil](https://developers.google.com/compute/docs/gcutil/#install) for
|
||||
Google Compute Engine tests.
|
||||
|
||||
* [h1-cli](https://github.com/hyperonecom/h1-client-go) for HyperOne tests.
|
||||
|
||||
### Configuring Tests
|
||||
|
||||
**For tests that require AWS credentials:**
|
||||
@ -44,6 +46,15 @@ Set the following environmental variables:
|
||||
* `GC_ACCOUNT_FILE`
|
||||
* `GC_PROJECT_ID`
|
||||
|
||||
**For tests that test HyperOne:**
|
||||
|
||||
Set the following environmental variables:
|
||||
|
||||
* `HYPERONE_TOKEN`
|
||||
* `HYPERONE_PROJECT`
|
||||
|
||||
You have to be authenticated within the `h1` tool (use `h1 login`).
|
||||
|
||||
### Running
|
||||
|
||||
These tests are meant to be run _one file at a time_. There are some
|
||||
|
41
test/builder_hyperone.bats
Executable file
41
test/builder_hyperone.bats
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bats
|
||||
#
|
||||
# This tests the hyperone builder. The teardown function will
|
||||
# delete any images with the text "packerbats" within the name.
|
||||
|
||||
load test_helper
|
||||
fixtures builder-hyperone
|
||||
|
||||
# Required parameters
|
||||
: ${HYPERONE_TOKEN:?}
|
||||
: ${HYPERONE_PROJECT:?}
|
||||
command -v h1 >/dev/null 2>&1 || {
|
||||
echo "'h1' must be installed" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
USER_VARS="${USER_VARS} -var token=${HYPERONE_TOKEN}"
|
||||
USER_VARS="${USER_VARS} -var project=${HYPERONE_PROJECT}"
|
||||
|
||||
hyperone_has_image() {
|
||||
h1 image list --project-select=${HYPERONE_PROJECT} --output=tsv | grep $1 | wc -l
|
||||
}
|
||||
|
||||
teardown() {
|
||||
h1 image list --project-select=${HYPERONE_PROJECT} --output=tsv \
|
||||
| grep packerbats \
|
||||
| awk '{print $1}' \
|
||||
| xargs -n1 h1 image delete --project-select=${HYPERONE_PROJECT} --yes --image
|
||||
}
|
||||
|
||||
@test "hyperone: build minimal.json" {
|
||||
run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$(hyperone_has_image "packerbats-minimal")" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "hyperone: build chroot.json" {
|
||||
run packer build ${USER_VARS} $FIXTURE_ROOT/chroot.json
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$(hyperone_has_image "packerbats-chroot")" -eq 1 ]
|
||||
}
|
27
test/fixtures/builder-hyperone/chroot.json
vendored
Normal file
27
test/fixtures/builder-hyperone/chroot.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"variables": {
|
||||
"token": null,
|
||||
"project": null
|
||||
},
|
||||
"builders": [{
|
||||
"token": "{{ user `token` }}",
|
||||
"project": "{{ user `project` }}",
|
||||
"type": "hyperone",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10,
|
||||
"vm_type": "a1.nano",
|
||||
"chroot_disk": true,
|
||||
"chroot_command_wrapper": "sudo {{.Command}}",
|
||||
"pre_mount_commands": [
|
||||
"parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print",
|
||||
"mkfs.ext4 {{.Device}}1"
|
||||
],
|
||||
"post_mount_commands": [
|
||||
"apt-get update",
|
||||
"apt-get install debootstrap",
|
||||
"debootstrap --arch amd64 bionic {{.MountPath}}"
|
||||
],
|
||||
"image_name": "packerbats-chroot-{{timestamp}}"
|
||||
}],
|
||||
"provisioners": []
|
||||
}
|
15
test/fixtures/builder-hyperone/minimal.json
vendored
Normal file
15
test/fixtures/builder-hyperone/minimal.json
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"variables": {
|
||||
"token": null,
|
||||
"project": null
|
||||
},
|
||||
"builders": [{
|
||||
"token": "{{ user `token` }}",
|
||||
"project": "{{ user `project` }}",
|
||||
"type": "hyperone",
|
||||
"source_image": "ubuntu",
|
||||
"disk_size": 10,
|
||||
"vm_type": "a1.nano",
|
||||
"image_name": "packerbats-minimal-{{timestamp}}"
|
||||
}]
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
# be sure any test cases set this.
|
||||
|
||||
load test_helper
|
||||
verify_aws_cli
|
||||
fixtures provisioner-file
|
||||
|
||||
setup() {
|
||||
|
@ -5,6 +5,7 @@
|
||||
# be sure any test cases set this.
|
||||
|
||||
load test_helper
|
||||
verify_aws_cli
|
||||
fixtures provisioner-shell
|
||||
|
||||
setup() {
|
||||
|
@ -1,11 +1,13 @@
|
||||
# Let's verify that the tools we need are installed
|
||||
declare -a required=(aws)
|
||||
for cmd in "${required[@]}"; do
|
||||
command -v $cmd >/dev/null 2>&1 || {
|
||||
echo "'$cmd' must be installed" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
verify_aws_cli() {
|
||||
declare -a required=(aws)
|
||||
for cmd in "${required[@]}"; do
|
||||
command -v $cmd >/dev/null 2>&1 || {
|
||||
echo "'$cmd' must be installed" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Bats modification
|
||||
|
8
vendor/github.com/antihax/optional/LICENSE
generated
vendored
Normal file
8
vendor/github.com/antihax/optional/LICENSE
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2016 Adam Hintz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
36
vendor/github.com/antihax/optional/bool.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/bool.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Bool struct {
|
||||
isSet bool
|
||||
value bool
|
||||
}
|
||||
|
||||
func NewBool(value bool) Bool {
|
||||
return Bool{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyBool returns a new Bool that does not have a value set.
|
||||
func EmptyBool() Bool {
|
||||
return Bool{
|
||||
false,
|
||||
false,
|
||||
}
|
||||
}
|
||||
|
||||
func (b Bool) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b Bool) Value() bool {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b Bool) Default(defaultValue bool) bool {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/byte.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/byte.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Byte struct {
|
||||
isSet bool
|
||||
value byte
|
||||
}
|
||||
|
||||
func NewByte(value byte) Byte {
|
||||
return Byte{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyByte returns a new Byte that does not have a value set.
|
||||
func EmptyByte() Byte {
|
||||
return Byte{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (b Byte) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b Byte) Value() byte {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b Byte) Default(defaultValue byte) byte {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/complex128.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/complex128.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Complex128 struct {
|
||||
isSet bool
|
||||
value complex128
|
||||
}
|
||||
|
||||
func NewComplex128(value complex128) Complex128 {
|
||||
return Complex128{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyComplex128 returns a new Complex128 that does not have a value set.
|
||||
func EmptyComplex128() Complex128 {
|
||||
return Complex128{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Complex128) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Complex128) Value() complex128 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Complex128) Default(defaultValue complex128) complex128 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/complex64.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/complex64.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Complex64 struct {
|
||||
isSet bool
|
||||
value complex64
|
||||
}
|
||||
|
||||
func NewComplex64(value complex64) Complex64 {
|
||||
return Complex64{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyComplex64 returns a new Complex64 that does not have a value set.
|
||||
func EmptyComplex64() Complex64 {
|
||||
return Complex64{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Complex64) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Complex64) Value() complex64 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Complex64) Default(defaultValue complex64) complex64 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/float32.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/float32.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Float32 struct {
|
||||
isSet bool
|
||||
value float32
|
||||
}
|
||||
|
||||
func NewFloat32(value float32) Float32 {
|
||||
return Float32{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyFloat32 returns a new Float32 that does not have a value set.
|
||||
func EmptyFloat32() Float32 {
|
||||
return Float32{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Float32) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Float32) Value() float32 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Float32) Default(defaultValue float32) float32 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/float64.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/float64.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Float64 struct {
|
||||
isSet bool
|
||||
value float64
|
||||
}
|
||||
|
||||
func NewFloat64(value float64) Float64 {
|
||||
return Float64{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyFloat64 returns a new Float64 that does not have a value set.
|
||||
func EmptyFloat64() Float64 {
|
||||
return Float64{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Float64) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Float64) Value() float64 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Float64) Default(defaultValue float64) float64 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/int.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/int.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Int struct {
|
||||
isSet bool
|
||||
value int
|
||||
}
|
||||
|
||||
func NewInt(value int) Int {
|
||||
return Int{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInt returns a new Int that does not have a value set.
|
||||
func EmptyInt() Int {
|
||||
return Int{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Int) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Int) Value() int {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Int) Default(defaultValue int) int {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/int16.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/int16.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Int16 struct {
|
||||
isSet bool
|
||||
value int16
|
||||
}
|
||||
|
||||
func NewInt16(value int16) Int16 {
|
||||
return Int16{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInt16 returns a new Int16 that does not have a value set.
|
||||
func EmptyInt16() Int16 {
|
||||
return Int16{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Int16) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Int16) Value() int16 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Int16) Default(defaultValue int16) int16 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/int32.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/int32.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Int32 struct {
|
||||
isSet bool
|
||||
value int32
|
||||
}
|
||||
|
||||
func NewInt32(value int32) Int32 {
|
||||
return Int32{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInt32 returns a new Int32 that does not have a value set.
|
||||
func EmptyInt32() Int32 {
|
||||
return Int32{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Int32) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Int32) Value() int32 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Int32) Default(defaultValue int32) int32 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/int64.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/int64.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Int64 struct {
|
||||
isSet bool
|
||||
value int64
|
||||
}
|
||||
|
||||
func NewInt64(value int64) Int64 {
|
||||
return Int64{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInt64 returns a new Int64 that does not have a value set.
|
||||
func EmptyInt64() Int64 {
|
||||
return Int64{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Int64) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Int64) Value() int64 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Int64) Default(defaultValue int64) int64 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/int8.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/int8.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Int8 struct {
|
||||
isSet bool
|
||||
value int8
|
||||
}
|
||||
|
||||
func NewInt8(value int8) Int8 {
|
||||
return Int8{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInt8 returns a new Int8 that does not have a value set.
|
||||
func EmptyInt8() Int8 {
|
||||
return Int8{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Int8) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Int8) Value() int8 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Int8) Default(defaultValue int8) int8 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
37
vendor/github.com/antihax/optional/interface.go
generated
vendored
Normal file
37
vendor/github.com/antihax/optional/interface.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
package optional
|
||||
|
||||
// Optional represents a generic optional type, stored as an interface{}.
|
||||
type Interface struct {
|
||||
isSet bool
|
||||
value interface{}
|
||||
}
|
||||
|
||||
func NewInterface(value interface{}) Interface {
|
||||
return Interface{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyInterface returns a new Interface that does not have a value set.
|
||||
func EmptyInterface() Interface {
|
||||
return Interface{
|
||||
false,
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
func (b Interface) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b Interface) Value() interface{} {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b Interface) Default(defaultValue interface{}) interface{} {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/rune.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/rune.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Rune struct {
|
||||
isSet bool
|
||||
value rune
|
||||
}
|
||||
|
||||
func NewRune(value rune) Rune {
|
||||
return Rune{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyRune returns a new Rune that does not have a value set.
|
||||
func EmptyRune() Rune {
|
||||
return Rune{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (b Rune) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b Rune) Value() rune {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b Rune) Default(defaultValue rune) rune {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/string.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/string.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type String struct {
|
||||
isSet bool
|
||||
value string
|
||||
}
|
||||
|
||||
func NewString(value string) String {
|
||||
return String{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyString returns a new String that does not have a value set.
|
||||
func EmptyString() String {
|
||||
return String{
|
||||
false,
|
||||
"",
|
||||
}
|
||||
}
|
||||
|
||||
func (b String) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b String) Value() string {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b String) Default(defaultValue string) string {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
38
vendor/github.com/antihax/optional/time.go
generated
vendored
Normal file
38
vendor/github.com/antihax/optional/time.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package optional
|
||||
|
||||
import "time"
|
||||
|
||||
type Time struct {
|
||||
isSet bool
|
||||
value time.Time
|
||||
}
|
||||
|
||||
func NewTime(value time.Time) Time {
|
||||
return Time{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyTime returns a new Time that does not have a value set.
|
||||
func EmptyTime() Time {
|
||||
return Time{
|
||||
false,
|
||||
time.Time{},
|
||||
}
|
||||
}
|
||||
|
||||
func (b Time) IsSet() bool {
|
||||
return b.isSet
|
||||
}
|
||||
|
||||
func (b Time) Value() time.Time {
|
||||
return b.value
|
||||
}
|
||||
|
||||
func (b Time) Default(defaultValue time.Time) time.Time {
|
||||
if b.isSet {
|
||||
return b.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uint.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uint.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uint struct {
|
||||
isSet bool
|
||||
value uint
|
||||
}
|
||||
|
||||
func NewUint(value uint) Uint {
|
||||
return Uint{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUint returns a new Uint that does not have a value set.
|
||||
func EmptyUint() Uint {
|
||||
return Uint{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uint) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uint) Value() uint {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uint) Default(defaultValue uint) uint {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uint16.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uint16.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uint16 struct {
|
||||
isSet bool
|
||||
value uint16
|
||||
}
|
||||
|
||||
func NewUint16(value uint16) Uint16 {
|
||||
return Uint16{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUint16 returns a new Uint16 that does not have a value set.
|
||||
func EmptyUint16() Uint16 {
|
||||
return Uint16{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uint16) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uint16) Value() uint16 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uint16) Default(defaultValue uint16) uint16 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uint32.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uint32.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uint32 struct {
|
||||
isSet bool
|
||||
value uint32
|
||||
}
|
||||
|
||||
func NewUint32(value uint32) Uint32 {
|
||||
return Uint32{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUint32 returns a new Uint32 that does not have a value set.
|
||||
func EmptyUint32() Uint32 {
|
||||
return Uint32{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uint32) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uint32) Value() uint32 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uint32) Default(defaultValue uint32) uint32 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uint64.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uint64.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uint64 struct {
|
||||
isSet bool
|
||||
value uint64
|
||||
}
|
||||
|
||||
func NewUint64(value uint64) Uint64 {
|
||||
return Uint64{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUint64 returns a new Uint64 that does not have a value set.
|
||||
func EmptyUint64() Uint64 {
|
||||
return Uint64{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uint64) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uint64) Value() uint64 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uint64) Default(defaultValue uint64) uint64 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uint8.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uint8.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uint8 struct {
|
||||
isSet bool
|
||||
value uint8
|
||||
}
|
||||
|
||||
func NewUint8(value uint8) Uint8 {
|
||||
return Uint8{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUint8 returns a new Uint8 that does not have a value set.
|
||||
func EmptyUint8() Uint8 {
|
||||
return Uint8{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uint8) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uint8) Value() uint8 {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uint8) Default(defaultValue uint8) uint8 {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
36
vendor/github.com/antihax/optional/uintptr.go
generated
vendored
Normal file
36
vendor/github.com/antihax/optional/uintptr.go
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
package optional
|
||||
|
||||
type Uintptr struct {
|
||||
isSet bool
|
||||
value uintptr
|
||||
}
|
||||
|
||||
func NewUintptr(value uintptr) Uintptr {
|
||||
return Uintptr{
|
||||
true,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
// EmptyUintptr returns a new Uintptr that does not have a value set.
|
||||
func EmptyUintptr() Uintptr {
|
||||
return Uintptr{
|
||||
false,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Uintptr) IsSet() bool {
|
||||
return i.isSet
|
||||
}
|
||||
|
||||
func (i Uintptr) Value() uintptr {
|
||||
return i.value
|
||||
}
|
||||
|
||||
func (i Uintptr) Default(defaultValue uintptr) uintptr {
|
||||
if i.isSet {
|
||||
return i.value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
24
vendor/github.com/hyperonecom/h1-client-go/.gitignore
generated
vendored
Normal file
24
vendor/github.com/hyperonecom/h1-client-go/.gitignore
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
23
vendor/github.com/hyperonecom/h1-client-go/.openapi-generator-ignore
generated
vendored
Normal file
23
vendor/github.com/hyperonecom/h1-client-go/.openapi-generator-ignore
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
8
vendor/github.com/hyperonecom/h1-client-go/.travis.yml
generated
vendored
Normal file
8
vendor/github.com/hyperonecom/h1-client-go/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
language: go
|
||||
|
||||
install:
|
||||
- go get -d -v .
|
||||
|
||||
script:
|
||||
- go build -v ./
|
||||
|
589
vendor/github.com/hyperonecom/h1-client-go/README.md
generated
vendored
Normal file
589
vendor/github.com/hyperonecom/h1-client-go/README.md
generated
vendored
Normal file
@ -0,0 +1,589 @@
|
||||
# Go API client for openapi
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
## Overview
|
||||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
|
||||
|
||||
- API version: 0.0.2
|
||||
- Package version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.GoClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
Install the following dependencies:
|
||||
```
|
||||
go get github.com/stretchr/testify/assert
|
||||
go get golang.org/x/oauth2
|
||||
go get golang.org/x/net/context
|
||||
go get github.com/antihax/optional
|
||||
```
|
||||
|
||||
Put the package under your project folder and add the following in import:
|
||||
```golang
|
||||
import "./openapi"
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://api.hyperone.com/v1*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*ContainerApi* | [**ContainerActionRestart**](docs/ContainerApi.md#containeractionrestart) | **Post** /container/{containerId}/actions/restart | /actions/restart
|
||||
*ContainerApi* | [**ContainerActionStart**](docs/ContainerApi.md#containeractionstart) | **Post** /container/{containerId}/actions/start | /actions/start
|
||||
*ContainerApi* | [**ContainerActionStop**](docs/ContainerApi.md#containeractionstop) | **Post** /container/{containerId}/actions/stop | /actions/stop
|
||||
*ContainerApi* | [**ContainerCreate**](docs/ContainerApi.md#containercreate) | **Post** /container | Create
|
||||
*ContainerApi* | [**ContainerDelete**](docs/ContainerApi.md#containerdelete) | **Delete** /container/{containerId} | Delete
|
||||
*ContainerApi* | [**ContainerDeleteAccessrightsIdentity**](docs/ContainerApi.md#containerdeleteaccessrightsidentity) | **Delete** /container/{containerId}/accessrights/{identity} | /accessrights/:identity
|
||||
*ContainerApi* | [**ContainerDeleteTagKey**](docs/ContainerApi.md#containerdeletetagkey) | **Delete** /container/{containerId}/tag/{key} | /tag/:key
|
||||
*ContainerApi* | [**ContainerGetServicesServiceId**](docs/ContainerApi.md#containergetservicesserviceid) | **Get** /container/{containerId}/services/{serviceId} | /services/:serviceId
|
||||
*ContainerApi* | [**ContainerGetTag**](docs/ContainerApi.md#containergettag) | **Get** /container/{containerId}/tag | /tag
|
||||
*ContainerApi* | [**ContainerList**](docs/ContainerApi.md#containerlist) | **Get** /container | List
|
||||
*ContainerApi* | [**ContainerListAccessrights**](docs/ContainerApi.md#containerlistaccessrights) | **Get** /container/{containerId}/accessrights | /accessrights
|
||||
*ContainerApi* | [**ContainerListQueue**](docs/ContainerApi.md#containerlistqueue) | **Get** /container/{containerId}/queue | /queue
|
||||
*ContainerApi* | [**ContainerListServices**](docs/ContainerApi.md#containerlistservices) | **Get** /container/{containerId}/services | /services
|
||||
*ContainerApi* | [**ContainerPatchTag**](docs/ContainerApi.md#containerpatchtag) | **Patch** /container/{containerId}/tag | /tag
|
||||
*ContainerApi* | [**ContainerPostAccessrights**](docs/ContainerApi.md#containerpostaccessrights) | **Post** /container/{containerId}/accessrights | /accessrights
|
||||
*ContainerApi* | [**ContainerShow**](docs/ContainerApi.md#containershow) | **Get** /container/{containerId} | Get
|
||||
*ContainerApi* | [**ContainerUpdate**](docs/ContainerApi.md#containerupdate) | **Patch** /container/{containerId} | Update
|
||||
*DiskApi* | [**DiskActionResize**](docs/DiskApi.md#diskactionresize) | **Post** /disk/{diskId}/actions/resize | /actions/resize
|
||||
*DiskApi* | [**DiskActionTransfer**](docs/DiskApi.md#diskactiontransfer) | **Post** /disk/{diskId}/actions/transfer | /actions/transfer
|
||||
*DiskApi* | [**DiskCreate**](docs/DiskApi.md#diskcreate) | **Post** /disk | Create
|
||||
*DiskApi* | [**DiskDelete**](docs/DiskApi.md#diskdelete) | **Delete** /disk/{diskId} | Delete
|
||||
*DiskApi* | [**DiskDeleteAccessrightsIdentity**](docs/DiskApi.md#diskdeleteaccessrightsidentity) | **Delete** /disk/{diskId}/accessrights/{identity} | /accessrights/:identity
|
||||
*DiskApi* | [**DiskDeleteTagKey**](docs/DiskApi.md#diskdeletetagkey) | **Delete** /disk/{diskId}/tag/{key} | /tag/:key
|
||||
*DiskApi* | [**DiskGetServicesServiceId**](docs/DiskApi.md#diskgetservicesserviceid) | **Get** /disk/{diskId}/services/{serviceId} | /services/:serviceId
|
||||
*DiskApi* | [**DiskGetTag**](docs/DiskApi.md#diskgettag) | **Get** /disk/{diskId}/tag | /tag
|
||||
*DiskApi* | [**DiskList**](docs/DiskApi.md#disklist) | **Get** /disk | List
|
||||
*DiskApi* | [**DiskListAccessrights**](docs/DiskApi.md#disklistaccessrights) | **Get** /disk/{diskId}/accessrights | /accessrights
|
||||
*DiskApi* | [**DiskListQueue**](docs/DiskApi.md#disklistqueue) | **Get** /disk/{diskId}/queue | /queue
|
||||
*DiskApi* | [**DiskListServices**](docs/DiskApi.md#disklistservices) | **Get** /disk/{diskId}/services | /services
|
||||
*DiskApi* | [**DiskPatchTag**](docs/DiskApi.md#diskpatchtag) | **Patch** /disk/{diskId}/tag | /tag
|
||||
*DiskApi* | [**DiskPostAccessrights**](docs/DiskApi.md#diskpostaccessrights) | **Post** /disk/{diskId}/accessrights | /accessrights
|
||||
*DiskApi* | [**DiskShow**](docs/DiskApi.md#diskshow) | **Get** /disk/{diskId} | Get
|
||||
*DiskApi* | [**DiskUpdate**](docs/DiskApi.md#diskupdate) | **Patch** /disk/{diskId} | Update
|
||||
*FirewallApi* | [**FirewallActionAttach**](docs/FirewallApi.md#firewallactionattach) | **Post** /firewall/{firewallId}/actions/attach | /actions/attach
|
||||
*FirewallApi* | [**FirewallActionDetach**](docs/FirewallApi.md#firewallactiondetach) | **Post** /firewall/{firewallId}/actions/detach | /actions/detach
|
||||
*FirewallApi* | [**FirewallActionTransfer**](docs/FirewallApi.md#firewallactiontransfer) | **Post** /firewall/{firewallId}/actions/transfer | /actions/transfer
|
||||
*FirewallApi* | [**FirewallCreate**](docs/FirewallApi.md#firewallcreate) | **Post** /firewall | Create
|
||||
*FirewallApi* | [**FirewallDelete**](docs/FirewallApi.md#firewalldelete) | **Delete** /firewall/{firewallId} | Delete
|
||||
*FirewallApi* | [**FirewallDeleteAccessrightsIdentity**](docs/FirewallApi.md#firewalldeleteaccessrightsidentity) | **Delete** /firewall/{firewallId}/accessrights/{identity} | /accessrights/:identity
|
||||
*FirewallApi* | [**FirewallDeleteEgressRuleId**](docs/FirewallApi.md#firewalldeleteegressruleid) | **Delete** /firewall/{firewallId}/egress/{ruleId} | /egress/:ruleId
|
||||
*FirewallApi* | [**FirewallDeleteIngressRuleId**](docs/FirewallApi.md#firewalldeleteingressruleid) | **Delete** /firewall/{firewallId}/ingress/{ruleId} | /ingress/:ruleId
|
||||
*FirewallApi* | [**FirewallDeleteTagKey**](docs/FirewallApi.md#firewalldeletetagkey) | **Delete** /firewall/{firewallId}/tag/{key} | /tag/:key
|
||||
*FirewallApi* | [**FirewallGetEgressRuleId**](docs/FirewallApi.md#firewallgetegressruleid) | **Get** /firewall/{firewallId}/egress/{ruleId} | /egress/:ruleId
|
||||
*FirewallApi* | [**FirewallGetIngressRuleId**](docs/FirewallApi.md#firewallgetingressruleid) | **Get** /firewall/{firewallId}/ingress/{ruleId} | /ingress/:ruleId
|
||||
*FirewallApi* | [**FirewallGetServicesServiceId**](docs/FirewallApi.md#firewallgetservicesserviceid) | **Get** /firewall/{firewallId}/services/{serviceId} | /services/:serviceId
|
||||
*FirewallApi* | [**FirewallGetTag**](docs/FirewallApi.md#firewallgettag) | **Get** /firewall/{firewallId}/tag | /tag
|
||||
*FirewallApi* | [**FirewallList**](docs/FirewallApi.md#firewalllist) | **Get** /firewall | List
|
||||
*FirewallApi* | [**FirewallListAccessrights**](docs/FirewallApi.md#firewalllistaccessrights) | **Get** /firewall/{firewallId}/accessrights | /accessrights
|
||||
*FirewallApi* | [**FirewallListEgress**](docs/FirewallApi.md#firewalllistegress) | **Get** /firewall/{firewallId}/egress | /egress
|
||||
*FirewallApi* | [**FirewallListIngress**](docs/FirewallApi.md#firewalllistingress) | **Get** /firewall/{firewallId}/ingress | /ingress
|
||||
*FirewallApi* | [**FirewallListQueue**](docs/FirewallApi.md#firewalllistqueue) | **Get** /firewall/{firewallId}/queue | /queue
|
||||
*FirewallApi* | [**FirewallListServices**](docs/FirewallApi.md#firewalllistservices) | **Get** /firewall/{firewallId}/services | /services
|
||||
*FirewallApi* | [**FirewallPatchTag**](docs/FirewallApi.md#firewallpatchtag) | **Patch** /firewall/{firewallId}/tag | /tag
|
||||
*FirewallApi* | [**FirewallPostAccessrights**](docs/FirewallApi.md#firewallpostaccessrights) | **Post** /firewall/{firewallId}/accessrights | /accessrights
|
||||
*FirewallApi* | [**FirewallPostEgress**](docs/FirewallApi.md#firewallpostegress) | **Post** /firewall/{firewallId}/egress | /egress
|
||||
*FirewallApi* | [**FirewallPostIngress**](docs/FirewallApi.md#firewallpostingress) | **Post** /firewall/{firewallId}/ingress | /ingress
|
||||
*FirewallApi* | [**FirewallShow**](docs/FirewallApi.md#firewallshow) | **Get** /firewall/{firewallId} | Get
|
||||
*FirewallApi* | [**FirewallUpdate**](docs/FirewallApi.md#firewallupdate) | **Patch** /firewall/{firewallId} | Update
|
||||
*ImageApi* | [**ImageActionTransfer**](docs/ImageApi.md#imageactiontransfer) | **Post** /image/{imageId}/actions/transfer | /actions/transfer
|
||||
*ImageApi* | [**ImageCreate**](docs/ImageApi.md#imagecreate) | **Post** /image | Create
|
||||
*ImageApi* | [**ImageDelete**](docs/ImageApi.md#imagedelete) | **Delete** /image/{imageId} | Delete
|
||||
*ImageApi* | [**ImageDeleteAccessrightsIdentity**](docs/ImageApi.md#imagedeleteaccessrightsidentity) | **Delete** /image/{imageId}/accessrights/{identity} | /accessrights/:identity
|
||||
*ImageApi* | [**ImageDeleteTagKey**](docs/ImageApi.md#imagedeletetagkey) | **Delete** /image/{imageId}/tag/{key} | /tag/:key
|
||||
*ImageApi* | [**ImageGetServicesServiceId**](docs/ImageApi.md#imagegetservicesserviceid) | **Get** /image/{imageId}/services/{serviceId} | /services/:serviceId
|
||||
*ImageApi* | [**ImageGetTag**](docs/ImageApi.md#imagegettag) | **Get** /image/{imageId}/tag | /tag
|
||||
*ImageApi* | [**ImageList**](docs/ImageApi.md#imagelist) | **Get** /image | List
|
||||
*ImageApi* | [**ImageListAccessrights**](docs/ImageApi.md#imagelistaccessrights) | **Get** /image/{imageId}/accessrights | /accessrights
|
||||
*ImageApi* | [**ImageListQueue**](docs/ImageApi.md#imagelistqueue) | **Get** /image/{imageId}/queue | /queue
|
||||
*ImageApi* | [**ImageListServices**](docs/ImageApi.md#imagelistservices) | **Get** /image/{imageId}/services | /services
|
||||
*ImageApi* | [**ImagePatchTag**](docs/ImageApi.md#imagepatchtag) | **Patch** /image/{imageId}/tag | /tag
|
||||
*ImageApi* | [**ImagePostAccessrights**](docs/ImageApi.md#imagepostaccessrights) | **Post** /image/{imageId}/accessrights | /accessrights
|
||||
*ImageApi* | [**ImageShow**](docs/ImageApi.md#imageshow) | **Get** /image/{imageId} | Get
|
||||
*ImageApi* | [**ImageUpdate**](docs/ImageApi.md#imageupdate) | **Patch** /image/{imageId} | Update
|
||||
*IpApi* | [**IpActionAllocate**](docs/IpApi.md#ipactionallocate) | **Post** /ip/{ipId}/actions/allocate | /actions/allocate
|
||||
*IpApi* | [**IpActionAssociate**](docs/IpApi.md#ipactionassociate) | **Post** /ip/{ipId}/actions/associate | /actions/associate
|
||||
*IpApi* | [**IpActionDisassociate**](docs/IpApi.md#ipactiondisassociate) | **Post** /ip/{ipId}/actions/disassociate | /actions/disassociate
|
||||
*IpApi* | [**IpActionRelease**](docs/IpApi.md#ipactionrelease) | **Post** /ip/{ipId}/actions/release | /actions/release
|
||||
*IpApi* | [**IpActionTransfer**](docs/IpApi.md#ipactiontransfer) | **Post** /ip/{ipId}/actions/transfer | /actions/transfer
|
||||
*IpApi* | [**IpCreate**](docs/IpApi.md#ipcreate) | **Post** /ip | Create
|
||||
*IpApi* | [**IpDelete**](docs/IpApi.md#ipdelete) | **Delete** /ip/{ipId} | Delete
|
||||
*IpApi* | [**IpDeleteAccessrightsIdentity**](docs/IpApi.md#ipdeleteaccessrightsidentity) | **Delete** /ip/{ipId}/accessrights/{identity} | /accessrights/:identity
|
||||
*IpApi* | [**IpDeleteTagKey**](docs/IpApi.md#ipdeletetagkey) | **Delete** /ip/{ipId}/tag/{key} | /tag/:key
|
||||
*IpApi* | [**IpGetServicesServiceId**](docs/IpApi.md#ipgetservicesserviceid) | **Get** /ip/{ipId}/services/{serviceId} | /services/:serviceId
|
||||
*IpApi* | [**IpGetTag**](docs/IpApi.md#ipgettag) | **Get** /ip/{ipId}/tag | /tag
|
||||
*IpApi* | [**IpList**](docs/IpApi.md#iplist) | **Get** /ip | List
|
||||
*IpApi* | [**IpListAccessrights**](docs/IpApi.md#iplistaccessrights) | **Get** /ip/{ipId}/accessrights | /accessrights
|
||||
*IpApi* | [**IpListQueue**](docs/IpApi.md#iplistqueue) | **Get** /ip/{ipId}/queue | /queue
|
||||
*IpApi* | [**IpListServices**](docs/IpApi.md#iplistservices) | **Get** /ip/{ipId}/services | /services
|
||||
*IpApi* | [**IpPatchTag**](docs/IpApi.md#ippatchtag) | **Patch** /ip/{ipId}/tag | /tag
|
||||
*IpApi* | [**IpPostAccessrights**](docs/IpApi.md#ippostaccessrights) | **Post** /ip/{ipId}/accessrights | /accessrights
|
||||
*IpApi* | [**IpShow**](docs/IpApi.md#ipshow) | **Get** /ip/{ipId} | Get
|
||||
*IpApi* | [**IpUpdate**](docs/IpApi.md#ipupdate) | **Patch** /ip/{ipId} | Update
|
||||
*IsoApi* | [**IsoActionTransfer**](docs/IsoApi.md#isoactiontransfer) | **Post** /iso/{isoId}/actions/transfer | /actions/transfer
|
||||
*IsoApi* | [**IsoCreate**](docs/IsoApi.md#isocreate) | **Post** /iso | Create
|
||||
*IsoApi* | [**IsoDelete**](docs/IsoApi.md#isodelete) | **Delete** /iso/{isoId} | Delete
|
||||
*IsoApi* | [**IsoDeleteAccessrightsIdentity**](docs/IsoApi.md#isodeleteaccessrightsidentity) | **Delete** /iso/{isoId}/accessrights/{identity} | /accessrights/:identity
|
||||
*IsoApi* | [**IsoDeleteTagKey**](docs/IsoApi.md#isodeletetagkey) | **Delete** /iso/{isoId}/tag/{key} | /tag/:key
|
||||
*IsoApi* | [**IsoGetServicesServiceId**](docs/IsoApi.md#isogetservicesserviceid) | **Get** /iso/{isoId}/services/{serviceId} | /services/:serviceId
|
||||
*IsoApi* | [**IsoGetTag**](docs/IsoApi.md#isogettag) | **Get** /iso/{isoId}/tag | /tag
|
||||
*IsoApi* | [**IsoList**](docs/IsoApi.md#isolist) | **Get** /iso | List
|
||||
*IsoApi* | [**IsoListAccessrights**](docs/IsoApi.md#isolistaccessrights) | **Get** /iso/{isoId}/accessrights | /accessrights
|
||||
*IsoApi* | [**IsoListQueue**](docs/IsoApi.md#isolistqueue) | **Get** /iso/{isoId}/queue | /queue
|
||||
*IsoApi* | [**IsoListServices**](docs/IsoApi.md#isolistservices) | **Get** /iso/{isoId}/services | /services
|
||||
*IsoApi* | [**IsoPatchTag**](docs/IsoApi.md#isopatchtag) | **Patch** /iso/{isoId}/tag | /tag
|
||||
*IsoApi* | [**IsoPostAccessrights**](docs/IsoApi.md#isopostaccessrights) | **Post** /iso/{isoId}/accessrights | /accessrights
|
||||
*IsoApi* | [**IsoShow**](docs/IsoApi.md#isoshow) | **Get** /iso/{isoId} | Get
|
||||
*IsoApi* | [**IsoUpdate**](docs/IsoApi.md#isoupdate) | **Patch** /iso/{isoId} | Update
|
||||
*LogArchiveApi* | [**LogArchiveActionTransfer**](docs/LogArchiveApi.md#logarchiveactiontransfer) | **Post** /logArchive/{logArchiveId}/actions/transfer | /actions/transfer
|
||||
*LogArchiveApi* | [**LogArchiveCreate**](docs/LogArchiveApi.md#logarchivecreate) | **Post** /logArchive | Create
|
||||
*LogArchiveApi* | [**LogArchiveDelete**](docs/LogArchiveApi.md#logarchivedelete) | **Delete** /logArchive/{logArchiveId} | Delete
|
||||
*LogArchiveApi* | [**LogArchiveDeleteAccessrightsIdentity**](docs/LogArchiveApi.md#logarchivedeleteaccessrightsidentity) | **Delete** /logArchive/{logArchiveId}/accessrights/{identity} | /accessrights/:identity
|
||||
*LogArchiveApi* | [**LogArchiveDeleteCredentialcertificateId**](docs/LogArchiveApi.md#logarchivedeletecredentialcertificateid) | **Delete** /logArchive/{logArchiveId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*LogArchiveApi* | [**LogArchiveDeleteCredentialpasswordId**](docs/LogArchiveApi.md#logarchivedeletecredentialpasswordid) | **Delete** /logArchive/{logArchiveId}/credential/password/{id} | /credential/password/:id
|
||||
*LogArchiveApi* | [**LogArchiveDeleteTagKey**](docs/LogArchiveApi.md#logarchivedeletetagkey) | **Delete** /logArchive/{logArchiveId}/tag/{key} | /tag/:key
|
||||
*LogArchiveApi* | [**LogArchiveGetCredentialcertificateId**](docs/LogArchiveApi.md#logarchivegetcredentialcertificateid) | **Get** /logArchive/{logArchiveId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*LogArchiveApi* | [**LogArchiveGetCredentialpasswordId**](docs/LogArchiveApi.md#logarchivegetcredentialpasswordid) | **Get** /logArchive/{logArchiveId}/credential/password/{id} | /credential/password/:id
|
||||
*LogArchiveApi* | [**LogArchiveGetServicesServiceId**](docs/LogArchiveApi.md#logarchivegetservicesserviceid) | **Get** /logArchive/{logArchiveId}/services/{serviceId} | /services/:serviceId
|
||||
*LogArchiveApi* | [**LogArchiveGetTag**](docs/LogArchiveApi.md#logarchivegettag) | **Get** /logArchive/{logArchiveId}/tag | /tag
|
||||
*LogArchiveApi* | [**LogArchiveList**](docs/LogArchiveApi.md#logarchivelist) | **Get** /logArchive | List
|
||||
*LogArchiveApi* | [**LogArchiveListAccessrights**](docs/LogArchiveApi.md#logarchivelistaccessrights) | **Get** /logArchive/{logArchiveId}/accessrights | /accessrights
|
||||
*LogArchiveApi* | [**LogArchiveListCredentialcertificate**](docs/LogArchiveApi.md#logarchivelistcredentialcertificate) | **Get** /logArchive/{logArchiveId}/credential/certificate | /credential/certificate
|
||||
*LogArchiveApi* | [**LogArchiveListCredentialpassword**](docs/LogArchiveApi.md#logarchivelistcredentialpassword) | **Get** /logArchive/{logArchiveId}/credential/password | /credential/password
|
||||
*LogArchiveApi* | [**LogArchiveListQueue**](docs/LogArchiveApi.md#logarchivelistqueue) | **Get** /logArchive/{logArchiveId}/queue | /queue
|
||||
*LogArchiveApi* | [**LogArchiveListServices**](docs/LogArchiveApi.md#logarchivelistservices) | **Get** /logArchive/{logArchiveId}/services | /services
|
||||
*LogArchiveApi* | [**LogArchivePatchCredentialcertificateId**](docs/LogArchiveApi.md#logarchivepatchcredentialcertificateid) | **Patch** /logArchive/{logArchiveId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*LogArchiveApi* | [**LogArchivePatchCredentialpasswordId**](docs/LogArchiveApi.md#logarchivepatchcredentialpasswordid) | **Patch** /logArchive/{logArchiveId}/credential/password/{id} | /credential/password/:id
|
||||
*LogArchiveApi* | [**LogArchivePatchTag**](docs/LogArchiveApi.md#logarchivepatchtag) | **Patch** /logArchive/{logArchiveId}/tag | /tag
|
||||
*LogArchiveApi* | [**LogArchivePostAccessrights**](docs/LogArchiveApi.md#logarchivepostaccessrights) | **Post** /logArchive/{logArchiveId}/accessrights | /accessrights
|
||||
*LogArchiveApi* | [**LogArchivePostCredentialcertificate**](docs/LogArchiveApi.md#logarchivepostcredentialcertificate) | **Post** /logArchive/{logArchiveId}/credential/certificate | /credential/certificate
|
||||
*LogArchiveApi* | [**LogArchivePostCredentialpassword**](docs/LogArchiveApi.md#logarchivepostcredentialpassword) | **Post** /logArchive/{logArchiveId}/credential/password | /credential/password
|
||||
*LogArchiveApi* | [**LogArchiveShow**](docs/LogArchiveApi.md#logarchiveshow) | **Get** /logArchive/{logArchiveId} | Get
|
||||
*LogArchiveApi* | [**LogArchiveUpdate**](docs/LogArchiveApi.md#logarchiveupdate) | **Patch** /logArchive/{logArchiveId} | Update
|
||||
*NetadpApi* | [**NetadpDeleteAccessrightsIdentity**](docs/NetadpApi.md#netadpdeleteaccessrightsidentity) | **Delete** /netadp/{netadpId}/accessrights/{identity} | /accessrights/:identity
|
||||
*NetadpApi* | [**NetadpDeleteTagKey**](docs/NetadpApi.md#netadpdeletetagkey) | **Delete** /netadp/{netadpId}/tag/{key} | /tag/:key
|
||||
*NetadpApi* | [**NetadpGetServicesServiceId**](docs/NetadpApi.md#netadpgetservicesserviceid) | **Get** /netadp/{netadpId}/services/{serviceId} | /services/:serviceId
|
||||
*NetadpApi* | [**NetadpGetTag**](docs/NetadpApi.md#netadpgettag) | **Get** /netadp/{netadpId}/tag | /tag
|
||||
*NetadpApi* | [**NetadpList**](docs/NetadpApi.md#netadplist) | **Get** /netadp | List
|
||||
*NetadpApi* | [**NetadpListAccessrights**](docs/NetadpApi.md#netadplistaccessrights) | **Get** /netadp/{netadpId}/accessrights | /accessrights
|
||||
*NetadpApi* | [**NetadpListQueue**](docs/NetadpApi.md#netadplistqueue) | **Get** /netadp/{netadpId}/queue | /queue
|
||||
*NetadpApi* | [**NetadpListServices**](docs/NetadpApi.md#netadplistservices) | **Get** /netadp/{netadpId}/services | /services
|
||||
*NetadpApi* | [**NetadpPatchTag**](docs/NetadpApi.md#netadppatchtag) | **Patch** /netadp/{netadpId}/tag | /tag
|
||||
*NetadpApi* | [**NetadpPostAccessrights**](docs/NetadpApi.md#netadppostaccessrights) | **Post** /netadp/{netadpId}/accessrights | /accessrights
|
||||
*NetadpApi* | [**NetadpShow**](docs/NetadpApi.md#netadpshow) | **Get** /netadp/{netadpId} | Get
|
||||
*NetgwApi* | [**NetgwActionAttach**](docs/NetgwApi.md#netgwactionattach) | **Post** /netgw/{netgwId}/actions/attach | /actions/attach
|
||||
*NetgwApi* | [**NetgwActionDetach**](docs/NetgwApi.md#netgwactiondetach) | **Post** /netgw/{netgwId}/actions/detach | /actions/detach
|
||||
*NetgwApi* | [**NetgwCreate**](docs/NetgwApi.md#netgwcreate) | **Post** /netgw | Create
|
||||
*NetgwApi* | [**NetgwDelete**](docs/NetgwApi.md#netgwdelete) | **Delete** /netgw/{netgwId} | Delete
|
||||
*NetgwApi* | [**NetgwDeleteAccessrightsIdentity**](docs/NetgwApi.md#netgwdeleteaccessrightsidentity) | **Delete** /netgw/{netgwId}/accessrights/{identity} | /accessrights/:identity
|
||||
*NetgwApi* | [**NetgwDeleteTagKey**](docs/NetgwApi.md#netgwdeletetagkey) | **Delete** /netgw/{netgwId}/tag/{key} | /tag/:key
|
||||
*NetgwApi* | [**NetgwGetServicesServiceId**](docs/NetgwApi.md#netgwgetservicesserviceid) | **Get** /netgw/{netgwId}/services/{serviceId} | /services/:serviceId
|
||||
*NetgwApi* | [**NetgwGetTag**](docs/NetgwApi.md#netgwgettag) | **Get** /netgw/{netgwId}/tag | /tag
|
||||
*NetgwApi* | [**NetgwList**](docs/NetgwApi.md#netgwlist) | **Get** /netgw | List
|
||||
*NetgwApi* | [**NetgwListAccessrights**](docs/NetgwApi.md#netgwlistaccessrights) | **Get** /netgw/{netgwId}/accessrights | /accessrights
|
||||
*NetgwApi* | [**NetgwListQueue**](docs/NetgwApi.md#netgwlistqueue) | **Get** /netgw/{netgwId}/queue | /queue
|
||||
*NetgwApi* | [**NetgwListServices**](docs/NetgwApi.md#netgwlistservices) | **Get** /netgw/{netgwId}/services | /services
|
||||
*NetgwApi* | [**NetgwPatchTag**](docs/NetgwApi.md#netgwpatchtag) | **Patch** /netgw/{netgwId}/tag | /tag
|
||||
*NetgwApi* | [**NetgwPostAccessrights**](docs/NetgwApi.md#netgwpostaccessrights) | **Post** /netgw/{netgwId}/accessrights | /accessrights
|
||||
*NetgwApi* | [**NetgwShow**](docs/NetgwApi.md#netgwshow) | **Get** /netgw/{netgwId} | Get
|
||||
*NetgwApi* | [**NetgwUpdate**](docs/NetgwApi.md#netgwupdate) | **Patch** /netgw/{netgwId} | Update
|
||||
*NetworkApi* | [**NetworkCreate**](docs/NetworkApi.md#networkcreate) | **Post** /network | Create
|
||||
*NetworkApi* | [**NetworkDelete**](docs/NetworkApi.md#networkdelete) | **Delete** /network/{networkId} | Delete
|
||||
*NetworkApi* | [**NetworkDeleteAccessrightsIdentity**](docs/NetworkApi.md#networkdeleteaccessrightsidentity) | **Delete** /network/{networkId}/accessrights/{identity} | /accessrights/:identity
|
||||
*NetworkApi* | [**NetworkDeleteIpIpId**](docs/NetworkApi.md#networkdeleteipipid) | **Delete** /network/{networkId}/ip/{ipId} | /ip/:ipId
|
||||
*NetworkApi* | [**NetworkDeleteTagKey**](docs/NetworkApi.md#networkdeletetagkey) | **Delete** /network/{networkId}/tag/{key} | /tag/:key
|
||||
*NetworkApi* | [**NetworkGetIpIpId**](docs/NetworkApi.md#networkgetipipid) | **Get** /network/{networkId}/ip/{ipId} | /ip/:ipId
|
||||
*NetworkApi* | [**NetworkGetServicesServiceId**](docs/NetworkApi.md#networkgetservicesserviceid) | **Get** /network/{networkId}/services/{serviceId} | /services/:serviceId
|
||||
*NetworkApi* | [**NetworkGetTag**](docs/NetworkApi.md#networkgettag) | **Get** /network/{networkId}/tag | /tag
|
||||
*NetworkApi* | [**NetworkList**](docs/NetworkApi.md#networklist) | **Get** /network | List
|
||||
*NetworkApi* | [**NetworkListAccessrights**](docs/NetworkApi.md#networklistaccessrights) | **Get** /network/{networkId}/accessrights | /accessrights
|
||||
*NetworkApi* | [**NetworkListIp**](docs/NetworkApi.md#networklistip) | **Get** /network/{networkId}/ip | /ip
|
||||
*NetworkApi* | [**NetworkListQueue**](docs/NetworkApi.md#networklistqueue) | **Get** /network/{networkId}/queue | /queue
|
||||
*NetworkApi* | [**NetworkListServices**](docs/NetworkApi.md#networklistservices) | **Get** /network/{networkId}/services | /services
|
||||
*NetworkApi* | [**NetworkPatchTag**](docs/NetworkApi.md#networkpatchtag) | **Patch** /network/{networkId}/tag | /tag
|
||||
*NetworkApi* | [**NetworkPostAccessrights**](docs/NetworkApi.md#networkpostaccessrights) | **Post** /network/{networkId}/accessrights | /accessrights
|
||||
*NetworkApi* | [**NetworkPostIp**](docs/NetworkApi.md#networkpostip) | **Post** /network/{networkId}/ip | /ip
|
||||
*NetworkApi* | [**NetworkShow**](docs/NetworkApi.md#networkshow) | **Get** /network/{networkId} | Get
|
||||
*NetworkApi* | [**NetworkUpdate**](docs/NetworkApi.md#networkupdate) | **Patch** /network/{networkId} | Update
|
||||
*OrganisationApi* | [**OrganisationActionTransferAccept**](docs/OrganisationApi.md#organisationactiontransferaccept) | **Post** /organisation/{organisationId}/actions/transfer_accept | /actions/transfer_accept
|
||||
*OrganisationApi* | [**OrganisationCreate**](docs/OrganisationApi.md#organisationcreate) | **Post** /organisation | Create
|
||||
*OrganisationApi* | [**OrganisationDeleteAccessrightsId**](docs/OrganisationApi.md#organisationdeleteaccessrightsid) | **Delete** /organisation/{organisationId}/accessrights/{id} | /accessrights/:id
|
||||
*OrganisationApi* | [**OrganisationDeleteTagKey**](docs/OrganisationApi.md#organisationdeletetagkey) | **Delete** /organisation/{organisationId}/tag/{key} | /tag/:key
|
||||
*OrganisationApi* | [**OrganisationGetTag**](docs/OrganisationApi.md#organisationgettag) | **Get** /organisation/{organisationId}/tag | /tag
|
||||
*OrganisationApi* | [**OrganisationList**](docs/OrganisationApi.md#organisationlist) | **Get** /organisation | List
|
||||
*OrganisationApi* | [**OrganisationListAccessrights**](docs/OrganisationApi.md#organisationlistaccessrights) | **Get** /organisation/{organisationId}/accessrights | /accessrights
|
||||
*OrganisationApi* | [**OrganisationListQueue**](docs/OrganisationApi.md#organisationlistqueue) | **Get** /organisation/{organisationId}/queue | /queue
|
||||
*OrganisationApi* | [**OrganisationPatchTag**](docs/OrganisationApi.md#organisationpatchtag) | **Patch** /organisation/{organisationId}/tag | /tag
|
||||
*OrganisationApi* | [**OrganisationPostAccessrights**](docs/OrganisationApi.md#organisationpostaccessrights) | **Post** /organisation/{organisationId}/accessrights | /accessrights
|
||||
*OrganisationApi* | [**OrganisationShow**](docs/OrganisationApi.md#organisationshow) | **Get** /organisation/{organisationId} | Get
|
||||
*OrganisationApi* | [**OrganisationUpdate**](docs/OrganisationApi.md#organisationupdate) | **Patch** /organisation/{organisationId} | Update
|
||||
*ProjectApi* | [**ProjectCreate**](docs/ProjectApi.md#projectcreate) | **Post** /project | Create
|
||||
*ProjectApi* | [**ProjectDelete**](docs/ProjectApi.md#projectdelete) | **Delete** /project/{projectId} | Delete
|
||||
*ProjectApi* | [**ProjectDeleteAccessrightsId**](docs/ProjectApi.md#projectdeleteaccessrightsid) | **Delete** /project/{projectId}/accessrights/{id} | /accessrights/:id
|
||||
*ProjectApi* | [**ProjectDeleteCredentialStorecertificateId**](docs/ProjectApi.md#projectdeletecredentialstorecertificateid) | **Delete** /project/{projectId}/credentialStore/certificate/{id} | /credentialStore/certificate/:id
|
||||
*ProjectApi* | [**ProjectDeleteTagKey**](docs/ProjectApi.md#projectdeletetagkey) | **Delete** /project/{projectId}/tag/{key} | /tag/:key
|
||||
*ProjectApi* | [**ProjectGetCredentialStorecertificateId**](docs/ProjectApi.md#projectgetcredentialstorecertificateid) | **Get** /project/{projectId}/credentialStore/certificate/{id} | /credentialStore/certificate/:id
|
||||
*ProjectApi* | [**ProjectGetServicesServiceId**](docs/ProjectApi.md#projectgetservicesserviceid) | **Get** /project/{projectId}/services/{serviceId} | /services/:serviceId
|
||||
*ProjectApi* | [**ProjectGetTag**](docs/ProjectApi.md#projectgettag) | **Get** /project/{projectId}/tag | /tag
|
||||
*ProjectApi* | [**ProjectList**](docs/ProjectApi.md#projectlist) | **Get** /project | List
|
||||
*ProjectApi* | [**ProjectListAccessrights**](docs/ProjectApi.md#projectlistaccessrights) | **Get** /project/{projectId}/accessrights | /accessrights
|
||||
*ProjectApi* | [**ProjectListCredentialStorecertificate**](docs/ProjectApi.md#projectlistcredentialstorecertificate) | **Get** /project/{projectId}/credentialStore/certificate | /credentialStore/certificate
|
||||
*ProjectApi* | [**ProjectListQueue**](docs/ProjectApi.md#projectlistqueue) | **Get** /project/{projectId}/queue | /queue
|
||||
*ProjectApi* | [**ProjectListServices**](docs/ProjectApi.md#projectlistservices) | **Get** /project/{projectId}/services | /services
|
||||
*ProjectApi* | [**ProjectPatchCredentialStorecertificateId**](docs/ProjectApi.md#projectpatchcredentialstorecertificateid) | **Patch** /project/{projectId}/credentialStore/certificate/{id} | /credentialStore/certificate/:id
|
||||
*ProjectApi* | [**ProjectPatchTag**](docs/ProjectApi.md#projectpatchtag) | **Patch** /project/{projectId}/tag | /tag
|
||||
*ProjectApi* | [**ProjectPostAccessrights**](docs/ProjectApi.md#projectpostaccessrights) | **Post** /project/{projectId}/accessrights | /accessrights
|
||||
*ProjectApi* | [**ProjectPostCredentialStorecertificate**](docs/ProjectApi.md#projectpostcredentialstorecertificate) | **Post** /project/{projectId}/credentialStore/certificate | /credentialStore/certificate
|
||||
*ProjectApi* | [**ProjectShow**](docs/ProjectApi.md#projectshow) | **Get** /project/{projectId} | Get
|
||||
*ProjectApi* | [**ProjectUpdate**](docs/ProjectApi.md#projectupdate) | **Patch** /project/{projectId} | Update
|
||||
*ReplicaApi* | [**ReplicaActionImage**](docs/ReplicaApi.md#replicaactionimage) | **Post** /replica/{replicaId}/actions/image | /actions/image
|
||||
*ReplicaApi* | [**ReplicaCreate**](docs/ReplicaApi.md#replicacreate) | **Post** /replica | Create
|
||||
*ReplicaApi* | [**ReplicaDelete**](docs/ReplicaApi.md#replicadelete) | **Delete** /replica/{replicaId} | Delete
|
||||
*ReplicaApi* | [**ReplicaDeleteAccessrightsIdentity**](docs/ReplicaApi.md#replicadeleteaccessrightsidentity) | **Delete** /replica/{replicaId}/accessrights/{identity} | /accessrights/:identity
|
||||
*ReplicaApi* | [**ReplicaDeleteTagKey**](docs/ReplicaApi.md#replicadeletetagkey) | **Delete** /replica/{replicaId}/tag/{key} | /tag/:key
|
||||
*ReplicaApi* | [**ReplicaGetServicesServiceId**](docs/ReplicaApi.md#replicagetservicesserviceid) | **Get** /replica/{replicaId}/services/{serviceId} | /services/:serviceId
|
||||
*ReplicaApi* | [**ReplicaGetTag**](docs/ReplicaApi.md#replicagettag) | **Get** /replica/{replicaId}/tag | /tag
|
||||
*ReplicaApi* | [**ReplicaList**](docs/ReplicaApi.md#replicalist) | **Get** /replica | List
|
||||
*ReplicaApi* | [**ReplicaListAccessrights**](docs/ReplicaApi.md#replicalistaccessrights) | **Get** /replica/{replicaId}/accessrights | /accessrights
|
||||
*ReplicaApi* | [**ReplicaListQueue**](docs/ReplicaApi.md#replicalistqueue) | **Get** /replica/{replicaId}/queue | /queue
|
||||
*ReplicaApi* | [**ReplicaListServices**](docs/ReplicaApi.md#replicalistservices) | **Get** /replica/{replicaId}/services | /services
|
||||
*ReplicaApi* | [**ReplicaPatchTag**](docs/ReplicaApi.md#replicapatchtag) | **Patch** /replica/{replicaId}/tag | /tag
|
||||
*ReplicaApi* | [**ReplicaPostAccessrights**](docs/ReplicaApi.md#replicapostaccessrights) | **Post** /replica/{replicaId}/accessrights | /accessrights
|
||||
*ReplicaApi* | [**ReplicaShow**](docs/ReplicaApi.md#replicashow) | **Get** /replica/{replicaId} | Get
|
||||
*ReservationApi* | [**ReservationActionAssign**](docs/ReservationApi.md#reservationactionassign) | **Post** /reservation/{reservationId}/actions/assign | /actions/assign
|
||||
*ReservationApi* | [**ReservationActionExtend**](docs/ReservationApi.md#reservationactionextend) | **Post** /reservation/{reservationId}/actions/extend | /actions/extend
|
||||
*ReservationApi* | [**ReservationActionUnassign**](docs/ReservationApi.md#reservationactionunassign) | **Post** /reservation/{reservationId}/actions/unassign | /actions/unassign
|
||||
*ReservationApi* | [**ReservationCreate**](docs/ReservationApi.md#reservationcreate) | **Post** /reservation | Create
|
||||
*ReservationApi* | [**ReservationDelete**](docs/ReservationApi.md#reservationdelete) | **Delete** /reservation/{reservationId} | Delete
|
||||
*ReservationApi* | [**ReservationDeleteAccessrightsIdentity**](docs/ReservationApi.md#reservationdeleteaccessrightsidentity) | **Delete** /reservation/{reservationId}/accessrights/{identity} | /accessrights/:identity
|
||||
*ReservationApi* | [**ReservationDeleteTagKey**](docs/ReservationApi.md#reservationdeletetagkey) | **Delete** /reservation/{reservationId}/tag/{key} | /tag/:key
|
||||
*ReservationApi* | [**ReservationGetServicesServiceId**](docs/ReservationApi.md#reservationgetservicesserviceid) | **Get** /reservation/{reservationId}/services/{serviceId} | /services/:serviceId
|
||||
*ReservationApi* | [**ReservationGetTag**](docs/ReservationApi.md#reservationgettag) | **Get** /reservation/{reservationId}/tag | /tag
|
||||
*ReservationApi* | [**ReservationList**](docs/ReservationApi.md#reservationlist) | **Get** /reservation | List
|
||||
*ReservationApi* | [**ReservationListAccessrights**](docs/ReservationApi.md#reservationlistaccessrights) | **Get** /reservation/{reservationId}/accessrights | /accessrights
|
||||
*ReservationApi* | [**ReservationListQueue**](docs/ReservationApi.md#reservationlistqueue) | **Get** /reservation/{reservationId}/queue | /queue
|
||||
*ReservationApi* | [**ReservationListServices**](docs/ReservationApi.md#reservationlistservices) | **Get** /reservation/{reservationId}/services | /services
|
||||
*ReservationApi* | [**ReservationPatchTag**](docs/ReservationApi.md#reservationpatchtag) | **Patch** /reservation/{reservationId}/tag | /tag
|
||||
*ReservationApi* | [**ReservationPostAccessrights**](docs/ReservationApi.md#reservationpostaccessrights) | **Post** /reservation/{reservationId}/accessrights | /accessrights
|
||||
*ReservationApi* | [**ReservationShow**](docs/ReservationApi.md#reservationshow) | **Get** /reservation/{reservationId} | Get
|
||||
*ReservationApi* | [**ReservationUpdate**](docs/ReservationApi.md#reservationupdate) | **Patch** /reservation/{reservationId} | Update
|
||||
*SnapshotApi* | [**SnapshotCreate**](docs/SnapshotApi.md#snapshotcreate) | **Post** /snapshot | Create
|
||||
*SnapshotApi* | [**SnapshotDelete**](docs/SnapshotApi.md#snapshotdelete) | **Delete** /snapshot/{snapshotId} | Delete
|
||||
*SnapshotApi* | [**SnapshotDeleteAccessrightsIdentity**](docs/SnapshotApi.md#snapshotdeleteaccessrightsidentity) | **Delete** /snapshot/{snapshotId}/accessrights/{identity} | /accessrights/:identity
|
||||
*SnapshotApi* | [**SnapshotDeleteTagKey**](docs/SnapshotApi.md#snapshotdeletetagkey) | **Delete** /snapshot/{snapshotId}/tag/{key} | /tag/:key
|
||||
*SnapshotApi* | [**SnapshotGetServicesServiceId**](docs/SnapshotApi.md#snapshotgetservicesserviceid) | **Get** /snapshot/{snapshotId}/services/{serviceId} | /services/:serviceId
|
||||
*SnapshotApi* | [**SnapshotGetTag**](docs/SnapshotApi.md#snapshotgettag) | **Get** /snapshot/{snapshotId}/tag | /tag
|
||||
*SnapshotApi* | [**SnapshotList**](docs/SnapshotApi.md#snapshotlist) | **Get** /snapshot | List
|
||||
*SnapshotApi* | [**SnapshotListAccessrights**](docs/SnapshotApi.md#snapshotlistaccessrights) | **Get** /snapshot/{snapshotId}/accessrights | /accessrights
|
||||
*SnapshotApi* | [**SnapshotListQueue**](docs/SnapshotApi.md#snapshotlistqueue) | **Get** /snapshot/{snapshotId}/queue | /queue
|
||||
*SnapshotApi* | [**SnapshotListServices**](docs/SnapshotApi.md#snapshotlistservices) | **Get** /snapshot/{snapshotId}/services | /services
|
||||
*SnapshotApi* | [**SnapshotPatchTag**](docs/SnapshotApi.md#snapshotpatchtag) | **Patch** /snapshot/{snapshotId}/tag | /tag
|
||||
*SnapshotApi* | [**SnapshotPostAccessrights**](docs/SnapshotApi.md#snapshotpostaccessrights) | **Post** /snapshot/{snapshotId}/accessrights | /accessrights
|
||||
*SnapshotApi* | [**SnapshotShow**](docs/SnapshotApi.md#snapshotshow) | **Get** /snapshot/{snapshotId} | Get
|
||||
*SnapshotApi* | [**SnapshotUpdate**](docs/SnapshotApi.md#snapshotupdate) | **Patch** /snapshot/{snapshotId} | Update
|
||||
*VaultApi* | [**VaultActionResize**](docs/VaultApi.md#vaultactionresize) | **Post** /vault/{vaultId}/actions/resize | /actions/resize
|
||||
*VaultApi* | [**VaultActionSnapshot**](docs/VaultApi.md#vaultactionsnapshot) | **Post** /vault/{vaultId}/actions/snapshot | /actions/snapshot
|
||||
*VaultApi* | [**VaultActionStart**](docs/VaultApi.md#vaultactionstart) | **Post** /vault/{vaultId}/actions/start | /actions/start
|
||||
*VaultApi* | [**VaultActionStop**](docs/VaultApi.md#vaultactionstop) | **Post** /vault/{vaultId}/actions/stop | /actions/stop
|
||||
*VaultApi* | [**VaultCreate**](docs/VaultApi.md#vaultcreate) | **Post** /vault | Create
|
||||
*VaultApi* | [**VaultDelete**](docs/VaultApi.md#vaultdelete) | **Delete** /vault/{vaultId} | Delete
|
||||
*VaultApi* | [**VaultDeleteAccessrightsIdentity**](docs/VaultApi.md#vaultdeleteaccessrightsidentity) | **Delete** /vault/{vaultId}/accessrights/{identity} | /accessrights/:identity
|
||||
*VaultApi* | [**VaultDeleteCredentialcertificateId**](docs/VaultApi.md#vaultdeletecredentialcertificateid) | **Delete** /vault/{vaultId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*VaultApi* | [**VaultDeleteCredentialpasswordId**](docs/VaultApi.md#vaultdeletecredentialpasswordid) | **Delete** /vault/{vaultId}/credential/password/{id} | /credential/password/:id
|
||||
*VaultApi* | [**VaultDeleteTagKey**](docs/VaultApi.md#vaultdeletetagkey) | **Delete** /vault/{vaultId}/tag/{key} | /tag/:key
|
||||
*VaultApi* | [**VaultGetCredentialcertificateId**](docs/VaultApi.md#vaultgetcredentialcertificateid) | **Get** /vault/{vaultId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*VaultApi* | [**VaultGetCredentialpasswordId**](docs/VaultApi.md#vaultgetcredentialpasswordid) | **Get** /vault/{vaultId}/credential/password/{id} | /credential/password/:id
|
||||
*VaultApi* | [**VaultGetServicesServiceId**](docs/VaultApi.md#vaultgetservicesserviceid) | **Get** /vault/{vaultId}/services/{serviceId} | /services/:serviceId
|
||||
*VaultApi* | [**VaultGetTag**](docs/VaultApi.md#vaultgettag) | **Get** /vault/{vaultId}/tag | /tag
|
||||
*VaultApi* | [**VaultList**](docs/VaultApi.md#vaultlist) | **Get** /vault | List
|
||||
*VaultApi* | [**VaultListAccessrights**](docs/VaultApi.md#vaultlistaccessrights) | **Get** /vault/{vaultId}/accessrights | /accessrights
|
||||
*VaultApi* | [**VaultListCredentialcertificate**](docs/VaultApi.md#vaultlistcredentialcertificate) | **Get** /vault/{vaultId}/credential/certificate | /credential/certificate
|
||||
*VaultApi* | [**VaultListCredentialpassword**](docs/VaultApi.md#vaultlistcredentialpassword) | **Get** /vault/{vaultId}/credential/password | /credential/password
|
||||
*VaultApi* | [**VaultListQueue**](docs/VaultApi.md#vaultlistqueue) | **Get** /vault/{vaultId}/queue | /queue
|
||||
*VaultApi* | [**VaultListServices**](docs/VaultApi.md#vaultlistservices) | **Get** /vault/{vaultId}/services | /services
|
||||
*VaultApi* | [**VaultPatchCredentialcertificateId**](docs/VaultApi.md#vaultpatchcredentialcertificateid) | **Patch** /vault/{vaultId}/credential/certificate/{id} | /credential/certificate/:id
|
||||
*VaultApi* | [**VaultPatchCredentialpasswordId**](docs/VaultApi.md#vaultpatchcredentialpasswordid) | **Patch** /vault/{vaultId}/credential/password/{id} | /credential/password/:id
|
||||
*VaultApi* | [**VaultPatchTag**](docs/VaultApi.md#vaultpatchtag) | **Patch** /vault/{vaultId}/tag | /tag
|
||||
*VaultApi* | [**VaultPostAccessrights**](docs/VaultApi.md#vaultpostaccessrights) | **Post** /vault/{vaultId}/accessrights | /accessrights
|
||||
*VaultApi* | [**VaultPostCredentialcertificate**](docs/VaultApi.md#vaultpostcredentialcertificate) | **Post** /vault/{vaultId}/credential/certificate | /credential/certificate
|
||||
*VaultApi* | [**VaultPostCredentialpassword**](docs/VaultApi.md#vaultpostcredentialpassword) | **Post** /vault/{vaultId}/credential/password | /credential/password
|
||||
*VaultApi* | [**VaultShow**](docs/VaultApi.md#vaultshow) | **Get** /vault/{vaultId} | Get
|
||||
*VaultApi* | [**VaultUpdate**](docs/VaultApi.md#vaultupdate) | **Patch** /vault/{vaultId} | Update
|
||||
*VmApi* | [**VmActionFlavour**](docs/VmApi.md#vmactionflavour) | **Post** /vm/{vmId}/actions/flavour | /actions/flavour
|
||||
*VmApi* | [**VmActionImage**](docs/VmApi.md#vmactionimage) | **Post** /vm/{vmId}/actions/image | /actions/image
|
||||
*VmApi* | [**VmActionPasswordReset**](docs/VmApi.md#vmactionpasswordreset) | **Post** /vm/{vmId}/actions/password_reset | /actions/password_reset
|
||||
*VmApi* | [**VmActionRename**](docs/VmApi.md#vmactionrename) | **Post** /vm/{vmId}/actions/rename | /actions/rename
|
||||
*VmApi* | [**VmActionRestart**](docs/VmApi.md#vmactionrestart) | **Post** /vm/{vmId}/actions/restart | /actions/restart
|
||||
*VmApi* | [**VmActionStart**](docs/VmApi.md#vmactionstart) | **Post** /vm/{vmId}/actions/start | /actions/start
|
||||
*VmApi* | [**VmActionStop**](docs/VmApi.md#vmactionstop) | **Post** /vm/{vmId}/actions/stop | /actions/stop
|
||||
*VmApi* | [**VmActionTurnoff**](docs/VmApi.md#vmactionturnoff) | **Post** /vm/{vmId}/actions/turnoff | /actions/turnoff
|
||||
*VmApi* | [**VmCreate**](docs/VmApi.md#vmcreate) | **Post** /vm | Create
|
||||
*VmApi* | [**VmDelete**](docs/VmApi.md#vmdelete) | **Delete** /vm/{vmId} | Delete
|
||||
*VmApi* | [**VmDeleteAccessrightsIdentity**](docs/VmApi.md#vmdeleteaccessrightsidentity) | **Delete** /vm/{vmId}/accessrights/{identity} | /accessrights/:identity
|
||||
*VmApi* | [**VmDeleteHddDiskId**](docs/VmApi.md#vmdeletehdddiskid) | **Delete** /vm/{vmId}/hdd/{diskId} | /hdd/:diskId
|
||||
*VmApi* | [**VmDeleteNetadpNetadpId**](docs/VmApi.md#vmdeletenetadpnetadpid) | **Delete** /vm/{vmId}/netadp/{netadpId} | /netadp/:netadpId
|
||||
*VmApi* | [**VmDeleteTagKey**](docs/VmApi.md#vmdeletetagkey) | **Delete** /vm/{vmId}/tag/{key} | /tag/:key
|
||||
*VmApi* | [**VmGetServicesServiceId**](docs/VmApi.md#vmgetservicesserviceid) | **Get** /vm/{vmId}/services/{serviceId} | /services/:serviceId
|
||||
*VmApi* | [**VmGetTag**](docs/VmApi.md#vmgettag) | **Get** /vm/{vmId}/tag | /tag
|
||||
*VmApi* | [**VmList**](docs/VmApi.md#vmlist) | **Get** /vm | List
|
||||
*VmApi* | [**VmListAccessrights**](docs/VmApi.md#vmlistaccessrights) | **Get** /vm/{vmId}/accessrights | /accessrights
|
||||
*VmApi* | [**VmListHdd**](docs/VmApi.md#vmlisthdd) | **Get** /vm/{vmId}/hdd | /hdd
|
||||
*VmApi* | [**VmListNetadp**](docs/VmApi.md#vmlistnetadp) | **Get** /vm/{vmId}/netadp | /netadp
|
||||
*VmApi* | [**VmListQueue**](docs/VmApi.md#vmlistqueue) | **Get** /vm/{vmId}/queue | /queue
|
||||
*VmApi* | [**VmListServices**](docs/VmApi.md#vmlistservices) | **Get** /vm/{vmId}/services | /services
|
||||
*VmApi* | [**VmPatchTag**](docs/VmApi.md#vmpatchtag) | **Patch** /vm/{vmId}/tag | /tag
|
||||
*VmApi* | [**VmPostAccessrights**](docs/VmApi.md#vmpostaccessrights) | **Post** /vm/{vmId}/accessrights | /accessrights
|
||||
*VmApi* | [**VmPostHdd**](docs/VmApi.md#vmposthdd) | **Post** /vm/{vmId}/hdd | /hdd
|
||||
*VmApi* | [**VmPostNetadp**](docs/VmApi.md#vmpostnetadp) | **Post** /vm/{vmId}/netadp | /netadp
|
||||
*VmApi* | [**VmShow**](docs/VmApi.md#vmshow) | **Get** /vm/{vmId} | Get
|
||||
*VmApi* | [**VmUpdate**](docs/VmApi.md#vmupdate) | **Patch** /vm/{vmId} | Update
|
||||
*VmhostApi* | [**VmhostActionMoveDisk**](docs/VmhostApi.md#vmhostactionmovedisk) | **Post** /vmhost/{vmhostId}/actions/moveDisk | /actions/moveDisk
|
||||
*VmhostApi* | [**VmhostActionMoveISO**](docs/VmhostApi.md#vmhostactionmoveiso) | **Post** /vmhost/{vmhostId}/actions/moveISO | /actions/moveISO
|
||||
*VmhostApi* | [**VmhostActionMoveImage**](docs/VmhostApi.md#vmhostactionmoveimage) | **Post** /vmhost/{vmhostId}/actions/moveImage | /actions/moveImage
|
||||
*VmhostApi* | [**VmhostActionMoveVM**](docs/VmhostApi.md#vmhostactionmovevm) | **Post** /vmhost/{vmhostId}/actions/moveVM | /actions/moveVM
|
||||
*VmhostApi* | [**VmhostDelete**](docs/VmhostApi.md#vmhostdelete) | **Delete** /vmhost/{vmhostId} | Delete
|
||||
*VmhostApi* | [**VmhostDeleteAccessrightsIdentity**](docs/VmhostApi.md#vmhostdeleteaccessrightsidentity) | **Delete** /vmhost/{vmhostId}/accessrights/{identity} | /accessrights/:identity
|
||||
*VmhostApi* | [**VmhostDeleteTagKey**](docs/VmhostApi.md#vmhostdeletetagkey) | **Delete** /vmhost/{vmhostId}/tag/{key} | /tag/:key
|
||||
*VmhostApi* | [**VmhostGetServicesServiceId**](docs/VmhostApi.md#vmhostgetservicesserviceid) | **Get** /vmhost/{vmhostId}/services/{serviceId} | /services/:serviceId
|
||||
*VmhostApi* | [**VmhostGetTag**](docs/VmhostApi.md#vmhostgettag) | **Get** /vmhost/{vmhostId}/tag | /tag
|
||||
*VmhostApi* | [**VmhostList**](docs/VmhostApi.md#vmhostlist) | **Get** /vmhost | List
|
||||
*VmhostApi* | [**VmhostListAccessrights**](docs/VmhostApi.md#vmhostlistaccessrights) | **Get** /vmhost/{vmhostId}/accessrights | /accessrights
|
||||
*VmhostApi* | [**VmhostListQueue**](docs/VmhostApi.md#vmhostlistqueue) | **Get** /vmhost/{vmhostId}/queue | /queue
|
||||
*VmhostApi* | [**VmhostListServices**](docs/VmhostApi.md#vmhostlistservices) | **Get** /vmhost/{vmhostId}/services | /services
|
||||
*VmhostApi* | [**VmhostPatchTag**](docs/VmhostApi.md#vmhostpatchtag) | **Patch** /vmhost/{vmhostId}/tag | /tag
|
||||
*VmhostApi* | [**VmhostPostAccessrights**](docs/VmhostApi.md#vmhostpostaccessrights) | **Post** /vmhost/{vmhostId}/accessrights | /accessrights
|
||||
*VmhostApi* | [**VmhostShow**](docs/VmhostApi.md#vmhostshow) | **Get** /vmhost/{vmhostId} | Get
|
||||
*VmhostApi* | [**VmhostUpdate**](docs/VmhostApi.md#vmhostupdate) | **Patch** /vmhost/{vmhostId} | Update
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [AccessrightsUserRole](docs/AccessrightsUserRole.md)
|
||||
- [Container](docs/Container.md)
|
||||
- [ContainerCreate](docs/ContainerCreate.md)
|
||||
- [ContainerCreateExpose](docs/ContainerCreateExpose.md)
|
||||
- [ContainerCreateRegistry](docs/ContainerCreateRegistry.md)
|
||||
- [ContainerCreateVolumes](docs/ContainerCreateVolumes.md)
|
||||
- [ContainerPostAccessrights](docs/ContainerPostAccessrights.md)
|
||||
- [ContainerServices](docs/ContainerServices.md)
|
||||
- [ContainerUpdate](docs/ContainerUpdate.md)
|
||||
- [CredentialCertificate](docs/CredentialCertificate.md)
|
||||
- [CredentialPassword](docs/CredentialPassword.md)
|
||||
- [Disk](docs/Disk.md)
|
||||
- [DiskActionResize](docs/DiskActionResize.md)
|
||||
- [DiskActionTransfer](docs/DiskActionTransfer.md)
|
||||
- [DiskCreate](docs/DiskCreate.md)
|
||||
- [DiskMetadata](docs/DiskMetadata.md)
|
||||
- [DiskMetadataSource](docs/DiskMetadataSource.md)
|
||||
- [DiskPostAccessrights](docs/DiskPostAccessrights.md)
|
||||
- [DiskServices](docs/DiskServices.md)
|
||||
- [DiskUpdate](docs/DiskUpdate.md)
|
||||
- [Event](docs/Event.md)
|
||||
- [EventResource](docs/EventResource.md)
|
||||
- [Firewall](docs/Firewall.md)
|
||||
- [FirewallActionAttach](docs/FirewallActionAttach.md)
|
||||
- [FirewallActionTransfer](docs/FirewallActionTransfer.md)
|
||||
- [FirewallCreate](docs/FirewallCreate.md)
|
||||
- [FirewallPostAccessrights](docs/FirewallPostAccessrights.md)
|
||||
- [FirewallPostEgress](docs/FirewallPostEgress.md)
|
||||
- [FirewallPostIngress](docs/FirewallPostIngress.md)
|
||||
- [FirewallServices](docs/FirewallServices.md)
|
||||
- [FirewallUpdate](docs/FirewallUpdate.md)
|
||||
- [Hdd](docs/Hdd.md)
|
||||
- [HddDisk](docs/HddDisk.md)
|
||||
- [Image](docs/Image.md)
|
||||
- [ImageActionTransfer](docs/ImageActionTransfer.md)
|
||||
- [ImageAttachedOn](docs/ImageAttachedOn.md)
|
||||
- [ImageCreate](docs/ImageCreate.md)
|
||||
- [ImageDisk](docs/ImageDisk.md)
|
||||
- [ImageDisks](docs/ImageDisks.md)
|
||||
- [ImagePostAccessrights](docs/ImagePostAccessrights.md)
|
||||
- [ImageServices](docs/ImageServices.md)
|
||||
- [ImageUpdate](docs/ImageUpdate.md)
|
||||
- [ImageVm](docs/ImageVm.md)
|
||||
- [InlineResponse200](docs/InlineResponse200.md)
|
||||
- [InlineResponse2001](docs/InlineResponse2001.md)
|
||||
- [Ip](docs/Ip.md)
|
||||
- [IpActionAllocate](docs/IpActionAllocate.md)
|
||||
- [IpActionAssociate](docs/IpActionAssociate.md)
|
||||
- [IpActionTransfer](docs/IpActionTransfer.md)
|
||||
- [IpAssociated](docs/IpAssociated.md)
|
||||
- [IpCreate](docs/IpCreate.md)
|
||||
- [IpPostAccessrights](docs/IpPostAccessrights.md)
|
||||
- [IpServices](docs/IpServices.md)
|
||||
- [IpUpdate](docs/IpUpdate.md)
|
||||
- [Iso](docs/Iso.md)
|
||||
- [IsoActionTransfer](docs/IsoActionTransfer.md)
|
||||
- [IsoCreate](docs/IsoCreate.md)
|
||||
- [IsoPostAccessrights](docs/IsoPostAccessrights.md)
|
||||
- [IsoServices](docs/IsoServices.md)
|
||||
- [IsoUpdate](docs/IsoUpdate.md)
|
||||
- [LogArchive](docs/LogArchive.md)
|
||||
- [LogArchiveActionTransfer](docs/LogArchiveActionTransfer.md)
|
||||
- [LogArchiveCreate](docs/LogArchiveCreate.md)
|
||||
- [LogArchivePatchCredentialcertificateId](docs/LogArchivePatchCredentialcertificateId.md)
|
||||
- [LogArchivePatchCredentialpasswordId](docs/LogArchivePatchCredentialpasswordId.md)
|
||||
- [LogArchivePostAccessrights](docs/LogArchivePostAccessrights.md)
|
||||
- [LogArchivePostCredentialcertificate](docs/LogArchivePostCredentialcertificate.md)
|
||||
- [LogArchivePostCredentialpassword](docs/LogArchivePostCredentialpassword.md)
|
||||
- [LogArchiveServices](docs/LogArchiveServices.md)
|
||||
- [LogArchiveUpdate](docs/LogArchiveUpdate.md)
|
||||
- [Netadp](docs/Netadp.md)
|
||||
- [NetadpAssigned](docs/NetadpAssigned.md)
|
||||
- [NetadpPostAccessrights](docs/NetadpPostAccessrights.md)
|
||||
- [NetadpServices](docs/NetadpServices.md)
|
||||
- [Netgw](docs/Netgw.md)
|
||||
- [NetgwActionAttach](docs/NetgwActionAttach.md)
|
||||
- [NetgwActionAttachPrivate](docs/NetgwActionAttachPrivate.md)
|
||||
- [NetgwCreate](docs/NetgwCreate.md)
|
||||
- [NetgwCreatePublic](docs/NetgwCreatePublic.md)
|
||||
- [NetgwPostAccessrights](docs/NetgwPostAccessrights.md)
|
||||
- [NetgwServices](docs/NetgwServices.md)
|
||||
- [NetgwUpdate](docs/NetgwUpdate.md)
|
||||
- [Network](docs/Network.md)
|
||||
- [NetworkCreate](docs/NetworkCreate.md)
|
||||
- [NetworkDns](docs/NetworkDns.md)
|
||||
- [NetworkPostAccessrights](docs/NetworkPostAccessrights.md)
|
||||
- [NetworkPostIp](docs/NetworkPostIp.md)
|
||||
- [NetworkServices](docs/NetworkServices.md)
|
||||
- [NetworkUpdate](docs/NetworkUpdate.md)
|
||||
- [Organisation](docs/Organisation.md)
|
||||
- [OrganisationActionTransferAccept](docs/OrganisationActionTransferAccept.md)
|
||||
- [OrganisationBilling](docs/OrganisationBilling.md)
|
||||
- [OrganisationBillingAddress](docs/OrganisationBillingAddress.md)
|
||||
- [OrganisationCreate](docs/OrganisationCreate.md)
|
||||
- [OrganisationCreateAccessRights](docs/OrganisationCreateAccessRights.md)
|
||||
- [OrganisationCreateBilling](docs/OrganisationCreateBilling.md)
|
||||
- [OrganisationCreateBillingAddress](docs/OrganisationCreateBillingAddress.md)
|
||||
- [OrganisationLimit](docs/OrganisationLimit.md)
|
||||
- [OrganisationLimitOrganisation](docs/OrganisationLimitOrganisation.md)
|
||||
- [OrganisationPostAccessrights](docs/OrganisationPostAccessrights.md)
|
||||
- [OrganisationTransfer](docs/OrganisationTransfer.md)
|
||||
- [OrganisationUpdate](docs/OrganisationUpdate.md)
|
||||
- [OrganisationUpdateBilling](docs/OrganisationUpdateBilling.md)
|
||||
- [OrganisationUpdateBillingAddress](docs/OrganisationUpdateBillingAddress.md)
|
||||
- [Payment](docs/Payment.md)
|
||||
- [Project](docs/Project.md)
|
||||
- [ProjectAccess](docs/ProjectAccess.md)
|
||||
- [ProjectAccessRights](docs/ProjectAccessRights.md)
|
||||
- [ProjectBilling](docs/ProjectBilling.md)
|
||||
- [ProjectCompliance](docs/ProjectCompliance.md)
|
||||
- [ProjectCreate](docs/ProjectCreate.md)
|
||||
- [ProjectCreateAccessRights](docs/ProjectCreateAccessRights.md)
|
||||
- [ProjectDuplicate](docs/ProjectDuplicate.md)
|
||||
- [ProjectInvoices](docs/ProjectInvoices.md)
|
||||
- [ProjectLimit](docs/ProjectLimit.md)
|
||||
- [ProjectLimitDisk](docs/ProjectLimitDisk.md)
|
||||
- [ProjectLimitDomain](docs/ProjectLimitDomain.md)
|
||||
- [ProjectLimitIso](docs/ProjectLimitIso.md)
|
||||
- [ProjectLimitVm](docs/ProjectLimitVm.md)
|
||||
- [ProjectNetworkAcl](docs/ProjectNetworkAcl.md)
|
||||
- [ProjectPatchCredentialStorecertificateId](docs/ProjectPatchCredentialStorecertificateId.md)
|
||||
- [ProjectPostAccessrights](docs/ProjectPostAccessrights.md)
|
||||
- [ProjectPostCredentialStorecertificate](docs/ProjectPostCredentialStorecertificate.md)
|
||||
- [ProjectRoles](docs/ProjectRoles.md)
|
||||
- [ProjectServices](docs/ProjectServices.md)
|
||||
- [ProjectThreshold](docs/ProjectThreshold.md)
|
||||
- [ProjectThresholdCredits](docs/ProjectThresholdCredits.md)
|
||||
- [ProjectTransfer](docs/ProjectTransfer.md)
|
||||
- [ProjectUpdate](docs/ProjectUpdate.md)
|
||||
- [Replica](docs/Replica.md)
|
||||
- [ReplicaActionImage](docs/ReplicaActionImage.md)
|
||||
- [ReplicaCreate](docs/ReplicaCreate.md)
|
||||
- [ReplicaPostAccessrights](docs/ReplicaPostAccessrights.md)
|
||||
- [ReplicaServices](docs/ReplicaServices.md)
|
||||
- [Reservation](docs/Reservation.md)
|
||||
- [ReservationActionAssign](docs/ReservationActionAssign.md)
|
||||
- [ReservationCreate](docs/ReservationCreate.md)
|
||||
- [ReservationPostAccessrights](docs/ReservationPostAccessrights.md)
|
||||
- [ReservationServices](docs/ReservationServices.md)
|
||||
- [ReservationUpdate](docs/ReservationUpdate.md)
|
||||
- [Snapshot](docs/Snapshot.md)
|
||||
- [SnapshotCreate](docs/SnapshotCreate.md)
|
||||
- [SnapshotPostAccessrights](docs/SnapshotPostAccessrights.md)
|
||||
- [SnapshotServices](docs/SnapshotServices.md)
|
||||
- [SnapshotUpdate](docs/SnapshotUpdate.md)
|
||||
- [Vault](docs/Vault.md)
|
||||
- [VaultActionResize](docs/VaultActionResize.md)
|
||||
- [VaultActionSnapshot](docs/VaultActionSnapshot.md)
|
||||
- [VaultCreate](docs/VaultCreate.md)
|
||||
- [VaultCreateCredential](docs/VaultCreateCredential.md)
|
||||
- [VaultCreateCredentialCertificate](docs/VaultCreateCredentialCertificate.md)
|
||||
- [VaultCreateCredentialPassword](docs/VaultCreateCredentialPassword.md)
|
||||
- [VaultDelete](docs/VaultDelete.md)
|
||||
- [VaultPatchCredentialcertificateId](docs/VaultPatchCredentialcertificateId.md)
|
||||
- [VaultPatchCredentialpasswordId](docs/VaultPatchCredentialpasswordId.md)
|
||||
- [VaultPostAccessrights](docs/VaultPostAccessrights.md)
|
||||
- [VaultPostCredentialcertificate](docs/VaultPostCredentialcertificate.md)
|
||||
- [VaultPostCredentialpassword](docs/VaultPostCredentialpassword.md)
|
||||
- [VaultServices](docs/VaultServices.md)
|
||||
- [VaultUpdate](docs/VaultUpdate.md)
|
||||
- [Vm](docs/Vm.md)
|
||||
- [VmActionFlavour](docs/VmActionFlavour.md)
|
||||
- [VmActionImage](docs/VmActionImage.md)
|
||||
- [VmActionPasswordReset](docs/VmActionPasswordReset.md)
|
||||
- [VmActionRename](docs/VmActionRename.md)
|
||||
- [VmCreate](docs/VmCreate.md)
|
||||
- [VmCreateDisk](docs/VmCreateDisk.md)
|
||||
- [VmCreateNetadp](docs/VmCreateNetadp.md)
|
||||
- [VmCreatePassword](docs/VmCreatePassword.md)
|
||||
- [VmData](docs/VmData.md)
|
||||
- [VmDelete](docs/VmDelete.md)
|
||||
- [VmPostAccessrights](docs/VmPostAccessrights.md)
|
||||
- [VmPostHdd](docs/VmPostHdd.md)
|
||||
- [VmPostNetadp](docs/VmPostNetadp.md)
|
||||
- [VmServices](docs/VmServices.md)
|
||||
- [VmSourceImage](docs/VmSourceImage.md)
|
||||
- [VmUpdate](docs/VmUpdate.md)
|
||||
- [Vmhost](docs/Vmhost.md)
|
||||
- [VmhostActionMoveDisk](docs/VmhostActionMoveDisk.md)
|
||||
- [VmhostActionMoveImage](docs/VmhostActionMoveImage.md)
|
||||
- [VmhostActionMoveIso](docs/VmhostActionMoveIso.md)
|
||||
- [VmhostActionMoveVm](docs/VmhostActionMoveVm.md)
|
||||
- [VmhostPostAccessrights](docs/VmhostPostAccessrights.md)
|
||||
- [VmhostServices](docs/VmhostServices.md)
|
||||
- [VmhostUpdate](docs/VmhostUpdate.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
## Project
|
||||
- **Type**: API key
|
||||
|
||||
Example
|
||||
```golang
|
||||
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
|
||||
Key: "APIKEY",
|
||||
Prefix: "Bearer", // Omit if not necessary.
|
||||
})
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
## ServiceAccount
|
||||
- **Type**: API key
|
||||
|
||||
Example
|
||||
```golang
|
||||
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
|
||||
Key: "APIKEY",
|
||||
Prefix: "Bearer", // Omit if not necessary.
|
||||
})
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
## Session
|
||||
- **Type**: API key
|
||||
|
||||
Example
|
||||
```golang
|
||||
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
|
||||
Key: "APIKEY",
|
||||
Prefix: "Bearer", // Omit if not necessary.
|
||||
})
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
2199
vendor/github.com/hyperonecom/h1-client-go/api_container.go
generated
vendored
Normal file
2199
vendor/github.com/hyperonecom/h1-client-go/api_container.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2078
vendor/github.com/hyperonecom/h1-client-go/api_disk.go
generated
vendored
Normal file
2078
vendor/github.com/hyperonecom/h1-client-go/api_disk.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3227
vendor/github.com/hyperonecom/h1-client-go/api_firewall.go
generated
vendored
Normal file
3227
vendor/github.com/hyperonecom/h1-client-go/api_firewall.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1948
vendor/github.com/hyperonecom/h1-client-go/api_image.go
generated
vendored
Normal file
1948
vendor/github.com/hyperonecom/h1-client-go/api_image.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2462
vendor/github.com/hyperonecom/h1-client-go/api_ip.go
generated
vendored
Normal file
2462
vendor/github.com/hyperonecom/h1-client-go/api_ip.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1948
vendor/github.com/hyperonecom/h1-client-go/api_iso.go
generated
vendored
Normal file
1948
vendor/github.com/hyperonecom/h1-client-go/api_iso.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3252
vendor/github.com/hyperonecom/h1-client-go/api_log_archive.go
generated
vendored
Normal file
3252
vendor/github.com/hyperonecom/h1-client-go/api_log_archive.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1460
vendor/github.com/hyperonecom/h1-client-go/api_netadp.go
generated
vendored
Normal file
1460
vendor/github.com/hyperonecom/h1-client-go/api_netadp.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2075
vendor/github.com/hyperonecom/h1-client-go/api_netgw.go
generated
vendored
Normal file
2075
vendor/github.com/hyperonecom/h1-client-go/api_netgw.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2329
vendor/github.com/hyperonecom/h1-client-go/api_network.go
generated
vendored
Normal file
2329
vendor/github.com/hyperonecom/h1-client-go/api_network.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1594
vendor/github.com/hyperonecom/h1-client-go/api_organisation.go
generated
vendored
Normal file
1594
vendor/github.com/hyperonecom/h1-client-go/api_organisation.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2465
vendor/github.com/hyperonecom/h1-client-go/api_project.go
generated
vendored
Normal file
2465
vendor/github.com/hyperonecom/h1-client-go/api_project.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1818
vendor/github.com/hyperonecom/h1-client-go/api_replica.go
generated
vendored
Normal file
1818
vendor/github.com/hyperonecom/h1-client-go/api_replica.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2202
vendor/github.com/hyperonecom/h1-client-go/api_reservation.go
generated
vendored
Normal file
2202
vendor/github.com/hyperonecom/h1-client-go/api_reservation.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1823
vendor/github.com/hyperonecom/h1-client-go/api_snapshot.go
generated
vendored
Normal file
1823
vendor/github.com/hyperonecom/h1-client-go/api_snapshot.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3639
vendor/github.com/hyperonecom/h1-client-go/api_vault.go
generated
vendored
Normal file
3639
vendor/github.com/hyperonecom/h1-client-go/api_vault.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3655
vendor/github.com/hyperonecom/h1-client-go/api_vm.go
generated
vendored
Normal file
3655
vendor/github.com/hyperonecom/h1-client-go/api_vm.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2210
vendor/github.com/hyperonecom/h1-client-go/api_vmhost.go
generated
vendored
Normal file
2210
vendor/github.com/hyperonecom/h1-client-go/api_vmhost.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
529
vendor/github.com/hyperonecom/h1-client-go/client.go
generated
vendored
Normal file
529
vendor/github.com/hyperonecom/h1-client-go/client.go
generated
vendored
Normal file
@ -0,0 +1,529 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
var (
|
||||
jsonCheck = regexp.MustCompile("(?i:[application|text]/json)")
|
||||
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
|
||||
)
|
||||
|
||||
// APIClient manages communication with the HyperOne API API v0.0.2
|
||||
// In most cases there should be only one, shared, APIClient.
|
||||
type APIClient struct {
|
||||
cfg *Configuration
|
||||
common service // Reuse a single struct instead of allocating one for each service on the heap.
|
||||
|
||||
// API Services
|
||||
|
||||
ContainerApi *ContainerApiService
|
||||
|
||||
DiskApi *DiskApiService
|
||||
|
||||
FirewallApi *FirewallApiService
|
||||
|
||||
ImageApi *ImageApiService
|
||||
|
||||
IpApi *IpApiService
|
||||
|
||||
IsoApi *IsoApiService
|
||||
|
||||
LogArchiveApi *LogArchiveApiService
|
||||
|
||||
NetadpApi *NetadpApiService
|
||||
|
||||
NetgwApi *NetgwApiService
|
||||
|
||||
NetworkApi *NetworkApiService
|
||||
|
||||
OrganisationApi *OrganisationApiService
|
||||
|
||||
ProjectApi *ProjectApiService
|
||||
|
||||
ReplicaApi *ReplicaApiService
|
||||
|
||||
ReservationApi *ReservationApiService
|
||||
|
||||
SnapshotApi *SnapshotApiService
|
||||
|
||||
VaultApi *VaultApiService
|
||||
|
||||
VmApi *VmApiService
|
||||
|
||||
VmhostApi *VmhostApiService
|
||||
}
|
||||
|
||||
type service struct {
|
||||
client *APIClient
|
||||
}
|
||||
|
||||
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
|
||||
// optionally a custom http.Client to allow for advanced features such as caching.
|
||||
func NewAPIClient(cfg *Configuration) *APIClient {
|
||||
if cfg.HTTPClient == nil {
|
||||
cfg.HTTPClient = http.DefaultClient
|
||||
}
|
||||
|
||||
c := &APIClient{}
|
||||
c.cfg = cfg
|
||||
c.common.client = c
|
||||
|
||||
// API Services
|
||||
c.ContainerApi = (*ContainerApiService)(&c.common)
|
||||
c.DiskApi = (*DiskApiService)(&c.common)
|
||||
c.FirewallApi = (*FirewallApiService)(&c.common)
|
||||
c.ImageApi = (*ImageApiService)(&c.common)
|
||||
c.IpApi = (*IpApiService)(&c.common)
|
||||
c.IsoApi = (*IsoApiService)(&c.common)
|
||||
c.LogArchiveApi = (*LogArchiveApiService)(&c.common)
|
||||
c.NetadpApi = (*NetadpApiService)(&c.common)
|
||||
c.NetgwApi = (*NetgwApiService)(&c.common)
|
||||
c.NetworkApi = (*NetworkApiService)(&c.common)
|
||||
c.OrganisationApi = (*OrganisationApiService)(&c.common)
|
||||
c.ProjectApi = (*ProjectApiService)(&c.common)
|
||||
c.ReplicaApi = (*ReplicaApiService)(&c.common)
|
||||
c.ReservationApi = (*ReservationApiService)(&c.common)
|
||||
c.SnapshotApi = (*SnapshotApiService)(&c.common)
|
||||
c.VaultApi = (*VaultApiService)(&c.common)
|
||||
c.VmApi = (*VmApiService)(&c.common)
|
||||
c.VmhostApi = (*VmhostApiService)(&c.common)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func atoi(in string) (int, error) {
|
||||
return strconv.Atoi(in)
|
||||
}
|
||||
|
||||
// selectHeaderContentType select a content type from the available list.
|
||||
func selectHeaderContentType(contentTypes []string) string {
|
||||
if len(contentTypes) == 0 {
|
||||
return ""
|
||||
}
|
||||
if contains(contentTypes, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
return contentTypes[0] // use the first content type specified in 'consumes'
|
||||
}
|
||||
|
||||
// selectHeaderAccept join all accept types and return
|
||||
func selectHeaderAccept(accepts []string) string {
|
||||
if len(accepts) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
if contains(accepts, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
|
||||
return strings.Join(accepts, ",")
|
||||
}
|
||||
|
||||
// contains is a case insenstive match, finding needle in a haystack
|
||||
func contains(haystack []string, needle string) bool {
|
||||
for _, a := range haystack {
|
||||
if strings.ToLower(a) == strings.ToLower(needle) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Verify optional parameters are of the correct type.
|
||||
func typeCheckParameter(obj interface{}, expected string, name string) error {
|
||||
// Make sure there is an object.
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check the type is as expected.
|
||||
if reflect.TypeOf(obj).String() != expected {
|
||||
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
||||
func parameterToString(obj interface{}, collectionFormat string) string {
|
||||
var delimiter string
|
||||
|
||||
switch collectionFormat {
|
||||
case "pipes":
|
||||
delimiter = "|"
|
||||
case "ssv":
|
||||
delimiter = " "
|
||||
case "tsv":
|
||||
delimiter = "\t"
|
||||
case "csv":
|
||||
delimiter = ","
|
||||
}
|
||||
|
||||
if reflect.TypeOf(obj).Kind() == reflect.Slice {
|
||||
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
|
||||
} else if t, ok := obj.(time.Time); ok {
|
||||
return t.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%v", obj)
|
||||
}
|
||||
|
||||
// callAPI do the request.
|
||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||
return c.cfg.HTTPClient.Do(request)
|
||||
}
|
||||
|
||||
// Change base path to allow switching to mocks
|
||||
func (c *APIClient) ChangeBasePath(path string) {
|
||||
c.cfg.BasePath = path
|
||||
}
|
||||
|
||||
// prepareRequest build the request
|
||||
func (c *APIClient) prepareRequest(
|
||||
ctx context.Context,
|
||||
path string, method string,
|
||||
postBody interface{},
|
||||
headerParams map[string]string,
|
||||
queryParams url.Values,
|
||||
formParams url.Values,
|
||||
formFileName string,
|
||||
fileName string,
|
||||
fileBytes []byte) (localVarRequest *http.Request, err error) {
|
||||
|
||||
var body *bytes.Buffer
|
||||
|
||||
// Detect postBody type and post.
|
||||
if postBody != nil {
|
||||
contentType := headerParams["Content-Type"]
|
||||
if contentType == "" {
|
||||
contentType = detectContentType(postBody)
|
||||
headerParams["Content-Type"] = contentType
|
||||
}
|
||||
|
||||
body, err = setBody(postBody, contentType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// add form parameters and file if available.
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
|
||||
if body != nil {
|
||||
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
w := multipart.NewWriter(body)
|
||||
|
||||
for k, v := range formParams {
|
||||
for _, iv := range v {
|
||||
if strings.HasPrefix(k, "@") { // file
|
||||
err = addFile(w, k[1:], iv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else { // form value
|
||||
w.WriteField(k, iv)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(fileBytes) > 0 && fileName != "" {
|
||||
w.Boundary()
|
||||
//_, fileNm := filepath.Split(fileName)
|
||||
part, err := w.CreateFormFile(formFileName, filepath.Base(fileName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = part.Write(fileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
}
|
||||
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
w.Close()
|
||||
}
|
||||
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
|
||||
if body != nil {
|
||||
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
body.WriteString(formParams.Encode())
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
}
|
||||
|
||||
// Setup path and query parameters
|
||||
url, err := url.Parse(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Adding Query Param
|
||||
query := url.Query()
|
||||
for k, v := range queryParams {
|
||||
for _, iv := range v {
|
||||
query.Add(k, iv)
|
||||
}
|
||||
}
|
||||
|
||||
// Encode the parameters.
|
||||
url.RawQuery = query.Encode()
|
||||
|
||||
// Generate a new request
|
||||
if body != nil {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), body)
|
||||
} else {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), nil)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// add header parameters, if any
|
||||
if len(headerParams) > 0 {
|
||||
headers := http.Header{}
|
||||
for h, v := range headerParams {
|
||||
headers.Set(h, v)
|
||||
}
|
||||
localVarRequest.Header = headers
|
||||
}
|
||||
|
||||
// Override request host, if applicable
|
||||
if c.cfg.Host != "" {
|
||||
localVarRequest.Host = c.cfg.Host
|
||||
}
|
||||
|
||||
// Add the user agent to the request.
|
||||
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
|
||||
|
||||
if ctx != nil {
|
||||
// add context to the request
|
||||
localVarRequest = localVarRequest.WithContext(ctx)
|
||||
|
||||
// Walk through any authentication.
|
||||
|
||||
// OAuth2 authentication
|
||||
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
|
||||
// We were able to grab an oauth2 token from the context
|
||||
var latestToken *oauth2.Token
|
||||
if latestToken, err = tok.Token(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
latestToken.SetAuthHeader(localVarRequest)
|
||||
}
|
||||
|
||||
// Basic HTTP Authentication
|
||||
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
|
||||
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
|
||||
}
|
||||
|
||||
// AccessToken Authentication
|
||||
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
|
||||
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
|
||||
}
|
||||
}
|
||||
|
||||
for header, value := range c.cfg.DefaultHeader {
|
||||
localVarRequest.Header.Add(header, value)
|
||||
}
|
||||
|
||||
return localVarRequest, nil
|
||||
}
|
||||
|
||||
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
||||
if strings.Contains(contentType, "application/xml") {
|
||||
if err = xml.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
} else if strings.Contains(contentType, "application/json") {
|
||||
if err = json.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return errors.New("undefined response type")
|
||||
}
|
||||
|
||||
// Add a file to the multipart request
|
||||
func addFile(w *multipart.Writer, fieldName, path string) error {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(part, file)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Prevent trying to import "fmt"
|
||||
func reportError(format string, a ...interface{}) error {
|
||||
return fmt.Errorf(format, a...)
|
||||
}
|
||||
|
||||
// Set request body from an interface{}
|
||||
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
||||
if bodyBuf == nil {
|
||||
bodyBuf = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
if reader, ok := body.(io.Reader); ok {
|
||||
_, err = bodyBuf.ReadFrom(reader)
|
||||
} else if b, ok := body.([]byte); ok {
|
||||
_, err = bodyBuf.Write(b)
|
||||
} else if s, ok := body.(string); ok {
|
||||
_, err = bodyBuf.WriteString(s)
|
||||
} else if s, ok := body.(*string); ok {
|
||||
_, err = bodyBuf.WriteString(*s)
|
||||
} else if jsonCheck.MatchString(contentType) {
|
||||
err = json.NewEncoder(bodyBuf).Encode(body)
|
||||
} else if xmlCheck.MatchString(contentType) {
|
||||
xml.NewEncoder(bodyBuf).Encode(body)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if bodyBuf.Len() == 0 {
|
||||
err = fmt.Errorf("Invalid body type %s\n", contentType)
|
||||
return nil, err
|
||||
}
|
||||
return bodyBuf, nil
|
||||
}
|
||||
|
||||
// detectContentType method is used to figure out `Request.Body` content type for request header
|
||||
func detectContentType(body interface{}) string {
|
||||
contentType := "text/plain; charset=utf-8"
|
||||
kind := reflect.TypeOf(body).Kind()
|
||||
|
||||
switch kind {
|
||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||
contentType = "application/json; charset=utf-8"
|
||||
case reflect.String:
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
default:
|
||||
if b, ok := body.([]byte); ok {
|
||||
contentType = http.DetectContentType(b)
|
||||
} else if kind == reflect.Slice {
|
||||
contentType = "application/json; charset=utf-8"
|
||||
}
|
||||
}
|
||||
|
||||
return contentType
|
||||
}
|
||||
|
||||
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
|
||||
type cacheControl map[string]string
|
||||
|
||||
func parseCacheControl(headers http.Header) cacheControl {
|
||||
cc := cacheControl{}
|
||||
ccHeader := headers.Get("Cache-Control")
|
||||
for _, part := range strings.Split(ccHeader, ",") {
|
||||
part = strings.Trim(part, " ")
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
if strings.ContainsRune(part, '=') {
|
||||
keyval := strings.Split(part, "=")
|
||||
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
|
||||
} else {
|
||||
cc[part] = ""
|
||||
}
|
||||
}
|
||||
return cc
|
||||
}
|
||||
|
||||
// CacheExpires helper function to determine remaining time before repeating a request.
|
||||
func CacheExpires(r *http.Response) time.Time {
|
||||
// Figure out when the cache expires.
|
||||
var expires time.Time
|
||||
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
|
||||
if err != nil {
|
||||
return time.Now()
|
||||
}
|
||||
respCacheControl := parseCacheControl(r.Header)
|
||||
|
||||
if maxAge, ok := respCacheControl["max-age"]; ok {
|
||||
lifetime, err := time.ParseDuration(maxAge + "s")
|
||||
if err != nil {
|
||||
expires = now
|
||||
} else {
|
||||
expires = now.Add(lifetime)
|
||||
}
|
||||
} else {
|
||||
expiresHeader := r.Header.Get("Expires")
|
||||
if expiresHeader != "" {
|
||||
expires, err = time.Parse(time.RFC1123, expiresHeader)
|
||||
if err != nil {
|
||||
expires = now
|
||||
}
|
||||
}
|
||||
}
|
||||
return expires
|
||||
}
|
||||
|
||||
func strlen(s string) int {
|
||||
return utf8.RuneCountInString(s)
|
||||
}
|
||||
|
||||
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
|
||||
type GenericOpenAPIError struct {
|
||||
body []byte
|
||||
error string
|
||||
model interface{}
|
||||
}
|
||||
|
||||
// Error returns non-empty string if there was an error.
|
||||
func (e GenericOpenAPIError) Error() string {
|
||||
return e.error
|
||||
}
|
||||
|
||||
// Body returns the raw bytes of the response
|
||||
func (e GenericOpenAPIError) Body() []byte {
|
||||
return e.body
|
||||
}
|
||||
|
||||
// Model returns the unpacked model of the error
|
||||
func (e GenericOpenAPIError) Model() interface{} {
|
||||
return e.model
|
||||
}
|
72
vendor/github.com/hyperonecom/h1-client-go/configuration.go
generated
vendored
Normal file
72
vendor/github.com/hyperonecom/h1-client-go/configuration.go
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// contextKeys are used to identify the type of value in the context.
|
||||
// Since these are string, it is possible to get a short description of the
|
||||
// context key for logging and debugging using key.String().
|
||||
|
||||
type contextKey string
|
||||
|
||||
func (c contextKey) String() string {
|
||||
return "auth " + string(c)
|
||||
}
|
||||
|
||||
var (
|
||||
// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
|
||||
ContextOAuth2 = contextKey("token")
|
||||
|
||||
// ContextBasicAuth takes BasicAuth as authentication for the request.
|
||||
ContextBasicAuth = contextKey("basic")
|
||||
|
||||
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
||||
ContextAccessToken = contextKey("accesstoken")
|
||||
|
||||
// ContextAPIKey takes an APIKey as authentication for the request
|
||||
ContextAPIKey = contextKey("apikey")
|
||||
)
|
||||
|
||||
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
||||
type BasicAuth struct {
|
||||
UserName string `json:"userName,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
||||
type APIKey struct {
|
||||
Key string
|
||||
Prefix string
|
||||
}
|
||||
|
||||
type Configuration struct {
|
||||
BasePath string `json:"basePath,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
UserAgent string `json:"userAgent,omitempty"`
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
cfg := &Configuration{
|
||||
BasePath: "https://api.hyperone.com/v1",
|
||||
DefaultHeader: make(map[string]string),
|
||||
UserAgent: "OpenAPI-Generator/1.0.0/go",
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
c.DefaultHeader[key] = value
|
||||
}
|
52
vendor/github.com/hyperonecom/h1-client-go/git_push.sh
generated
vendored
Normal file
52
vendor/github.com/hyperonecom/h1-client-go/git_push.sh
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="GIT_USER_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
15
vendor/github.com/hyperonecom/h1-client-go/model_accessrights_user_role.go
generated
vendored
Normal file
15
vendor/github.com/hyperonecom/h1-client-go/model_accessrights_user_role.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type AccessrightsUserRole struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Role string `json:"role,omitempty"`
|
||||
}
|
32
vendor/github.com/hyperonecom/h1-client-go/model_container.go
generated
vendored
Normal file
32
vendor/github.com/hyperonecom/h1-client-go/model_container.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Container struct {
|
||||
Id string `json:"_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Services []ProjectServices `json:"services,omitempty"`
|
||||
Flavour string `json:"flavour,omitempty"`
|
||||
ModifiedOn time.Time `json:"modifiedOn,omitempty"`
|
||||
ModifiedBy string `json:"modifiedBy,omitempty"`
|
||||
CreatedBy string `json:"createdBy,omitempty"`
|
||||
CreatedOn time.Time `json:"createdOn,omitempty"`
|
||||
AccessRights []string `json:"accessRights,omitempty"`
|
||||
Processing bool `json:"processing,omitempty"`
|
||||
Created bool `json:"created,omitempty"`
|
||||
Queue []Event `json:"queue,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Tag map[string]interface{} `json:"tag,omitempty"`
|
||||
Project string `json:"project,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
}
|
22
vendor/github.com/hyperonecom/h1-client-go/model_container_create.go
generated
vendored
Normal file
22
vendor/github.com/hyperonecom/h1-client-go/model_container_create.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerCreate struct {
|
||||
Name string `json:"name"`
|
||||
Image string `json:"image"`
|
||||
Registry ContainerCreateRegistry `json:"registry,omitempty"`
|
||||
Service string `json:"service"`
|
||||
Expose ContainerCreateExpose `json:"expose,omitempty"`
|
||||
Env []string `json:"env,omitempty"`
|
||||
Command string `json:"command,omitempty"`
|
||||
Volumes []ContainerCreateVolumes `json:"volumes,omitempty"`
|
||||
Tag map[string]interface{} `json:"tag,omitempty"`
|
||||
}
|
15
vendor/github.com/hyperonecom/h1-client-go/model_container_create_expose.go
generated
vendored
Normal file
15
vendor/github.com/hyperonecom/h1-client-go/model_container_create_expose.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerCreateExpose struct {
|
||||
Port float32 `json:"port,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
}
|
15
vendor/github.com/hyperonecom/h1-client-go/model_container_create_registry.go
generated
vendored
Normal file
15
vendor/github.com/hyperonecom/h1-client-go/model_container_create_registry.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerCreateRegistry struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
16
vendor/github.com/hyperonecom/h1-client-go/model_container_create_volumes.go
generated
vendored
Normal file
16
vendor/github.com/hyperonecom/h1-client-go/model_container_create_volumes.go
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerCreateVolumes struct {
|
||||
Source string `json:"source"`
|
||||
SourcePath string `json:"sourcePath,omitempty"`
|
||||
Target string `json:"target"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_container_post_accessrights.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_container_post_accessrights.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerPostAccessrights struct {
|
||||
Identity string `json:"identity,omitempty"`
|
||||
}
|
20
vendor/github.com/hyperonecom/h1-client-go/model_container_services.go
generated
vendored
Normal file
20
vendor/github.com/hyperonecom/h1-client-go/model_container_services.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerServices struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OneTime bool `json:"oneTime,omitempty"`
|
||||
Billing string `json:"billing,omitempty"`
|
||||
Data map[string]interface{} `json:"data,omitempty"`
|
||||
SourceService string `json:"sourceService,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_container_update.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_container_update.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type ContainerUpdate struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
19
vendor/github.com/hyperonecom/h1-client-go/model_credential_certificate.go
generated
vendored
Normal file
19
vendor/github.com/hyperonecom/h1-client-go/model_credential_certificate.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type CredentialCertificate struct {
|
||||
CreatedBy string `json:"createdBy,omitempty"`
|
||||
CreatedOn string `json:"createdOn,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Id string `json:"_id,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
}
|
19
vendor/github.com/hyperonecom/h1-client-go/model_credential_password.go
generated
vendored
Normal file
19
vendor/github.com/hyperonecom/h1-client-go/model_credential_password.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type CredentialPassword struct {
|
||||
CreatedBy string `json:"createdBy,omitempty"`
|
||||
CreatedOn string `json:"createdOn,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Id string `json:"_id,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
}
|
37
vendor/github.com/hyperonecom/h1-client-go/model_disk.go
generated
vendored
Normal file
37
vendor/github.com/hyperonecom/h1-client-go/model_disk.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Disk struct {
|
||||
Id string `json:"_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Services []ProjectServices `json:"services,omitempty"`
|
||||
Flavour string `json:"flavour,omitempty"`
|
||||
ModifiedOn time.Time `json:"modifiedOn,omitempty"`
|
||||
ModifiedBy string `json:"modifiedBy,omitempty"`
|
||||
CreatedBy string `json:"createdBy,omitempty"`
|
||||
CreatedOn time.Time `json:"createdOn,omitempty"`
|
||||
AccessRights []string `json:"accessRights,omitempty"`
|
||||
Processing bool `json:"processing,omitempty"`
|
||||
Created bool `json:"created,omitempty"`
|
||||
Queue []Event `json:"queue,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Tag map[string]interface{} `json:"tag,omitempty"`
|
||||
Project string `json:"project,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Size float32 `json:"size,omitempty"`
|
||||
Vm string `json:"vm,omitempty"`
|
||||
Persistent bool `json:"persistent,omitempty"`
|
||||
DownloadUrl string `json:"downloadUrl,omitempty"`
|
||||
Metadata DiskMetadata `json:"metadata,omitempty"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_action_resize.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_action_resize.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskActionResize struct {
|
||||
Size float32 `json:"size,omitempty"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_action_transfer.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_action_transfer.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskActionTransfer struct {
|
||||
Project string `json:"project"`
|
||||
}
|
19
vendor/github.com/hyperonecom/h1-client-go/model_disk_create.go
generated
vendored
Normal file
19
vendor/github.com/hyperonecom/h1-client-go/model_disk_create.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskCreate struct {
|
||||
Service string `json:"service"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Size float32 `json:"size,omitempty"`
|
||||
Cloud string `json:"cloud,omitempty"`
|
||||
Metadata DiskMetadata `json:"metadata,omitempty"`
|
||||
Tag map[string]interface{} `json:"tag,omitempty"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_metadata.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_metadata.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskMetadata struct {
|
||||
Source DiskMetadataSource `json:"source,omitempty"`
|
||||
}
|
15
vendor/github.com/hyperonecom/h1-client-go/model_disk_metadata_source.go
generated
vendored
Normal file
15
vendor/github.com/hyperonecom/h1-client-go/model_disk_metadata_source.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskMetadataSource struct {
|
||||
Filename string `json:"filename,omitempty"`
|
||||
Size float32 `json:"size,omitempty"`
|
||||
}
|
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_post_accessrights.go
generated
vendored
Normal file
14
vendor/github.com/hyperonecom/h1-client-go/model_disk_post_accessrights.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskPostAccessrights struct {
|
||||
Identity string `json:"identity,omitempty"`
|
||||
}
|
20
vendor/github.com/hyperonecom/h1-client-go/model_disk_services.go
generated
vendored
Normal file
20
vendor/github.com/hyperonecom/h1-client-go/model_disk_services.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* HyperOne API
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 0.0.2
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package openapi
|
||||
|
||||
type DiskServices struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OneTime bool `json:"oneTime,omitempty"`
|
||||
Billing string `json:"billing,omitempty"`
|
||||
Data map[string]interface{} `json:"data,omitempty"`
|
||||
SourceService string `json:"sourceService,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user