diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index bee88b9ba..4831e5b61 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "github.com/hashicorp/terraform", "GoVersion": "go1.6", - "GodepVersion": "v61", + "GodepVersion": "v62", "Packages": [ "./..." ], @@ -1265,8 +1265,8 @@ }, { "ImportPath": "github.com/xanzy/go-cloudstack/cloudstack", - "Comment": "v1.2.0-61-g252eb1b", - "Rev": "252eb1b665d77aa31dedd435fab0a7da57b2d8c1" + "Comment": "2.0.0", + "Rev": "6e28220a0503ff25e2c1480791e23d12872140ac" }, { "ImportPath": "github.com/xanzy/ssh-agent", diff --git a/builtin/providers/cloudstack/resource_cloudstack_disk.go b/builtin/providers/cloudstack/resource_cloudstack_disk.go index 7e5b79b74..de187274b 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_disk.go +++ b/builtin/providers/cloudstack/resource_cloudstack_disk.go @@ -78,7 +78,8 @@ func resourceCloudStackDiskCreate(d *schema.ResourceData, meta interface{}) erro name := d.Get("name").(string) // Create a new parameter struct - p := cs.Volume.NewCreateVolumeParams(name) + p := cs.Volume.NewCreateVolumeParams() + p.SetName(name) // Retrieve the disk_offering ID diskofferingid, e := retrieveID(cs, "disk_offering", d.Get("disk_offering").(string)) diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AccountService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AccountService.go index 3c55ac0a5..98b49df34 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AccountService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AccountService.go @@ -894,7 +894,7 @@ func (s *AccountService) NewLockAccountParams(account string, domainid string) * return p } -// Locks an account +// This deprecated function used to locks an account. Look for the API DisableAccount instead func (s *AccountService) LockAccount(p *LockAccountParams) (*LockAccountResponse, error) { resp, err := s.cs.newRequest("lockAccount", p.toURLValues()) if err != nil { @@ -1512,7 +1512,7 @@ func (s *AccountService) NewAddAccountToProjectParams(projectid string) *AddAcco return p } -// Adds acoount to a project +// Adds account to a project func (s *AccountService) AddAccountToProject(p *AddAccountToProjectParams) (*AddAccountToProjectResponse, error) { resp, err := s.cs.newRequest("addAccountToProject", p.toURLValues()) if err != nil { @@ -1831,3 +1831,65 @@ type ProjectAccount struct { Vpclimit string `json:"vpclimit,omitempty"` Vpctotal int64 `json:"vpctotal,omitempty"` } + +type GetSolidFireAccountIdParams struct { + p map[string]interface{} +} + +func (p *GetSolidFireAccountIdParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["accountid"]; found { + u.Set("accountid", v.(string)) + } + if v, found := p.p["storageid"]; found { + u.Set("storageid", v.(string)) + } + return u +} + +func (p *GetSolidFireAccountIdParams) SetAccountid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["accountid"] = v + return +} + +func (p *GetSolidFireAccountIdParams) SetStorageid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["storageid"] = v + return +} + +// You should always use this function to get a new GetSolidFireAccountIdParams instance, +// as then you are sure you have configured all required params +func (s *AccountService) NewGetSolidFireAccountIdParams(accountid string, storageid string) *GetSolidFireAccountIdParams { + p := &GetSolidFireAccountIdParams{} + p.p = make(map[string]interface{}) + p.p["accountid"] = accountid + p.p["storageid"] = storageid + return p +} + +// Get SolidFire Account ID +func (s *AccountService) GetSolidFireAccountId(p *GetSolidFireAccountIdParams) (*GetSolidFireAccountIdResponse, error) { + resp, err := s.cs.newRequest("getSolidFireAccountId", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetSolidFireAccountIdResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetSolidFireAccountIdResponse struct { + SolidFireAccountId int64 `json:"solidFireAccountId,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AddressService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AddressService.go index fb5c586f7..fad347609 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AddressService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AddressService.go @@ -257,7 +257,7 @@ func (s *AddressService) NewDisassociateIpAddressParams(id string) *Disassociate return p } -// Disassociates an ip address from the account. +// Disassociates an IP address from the account. func (s *AddressService) DisassociateIpAddress(p *DisassociateIpAddressParams) (*DisassociateIpAddressResponse, error) { resp, err := s.cs.newRequest("disassociateIpAddress", p.toURLValues()) if err != nil { @@ -365,6 +365,9 @@ func (p *ListPublicIpAddressesParams) toURLValues() url.Values { if v, found := p.p["projectid"]; found { u.Set("projectid", v.(string)) } + if v, found := p.p["state"]; found { + u.Set("state", v.(string)) + } if v, found := p.p["tags"]; found { i := 0 for k, vv := range v.(map[string]string) { @@ -529,6 +532,14 @@ func (p *ListPublicIpAddressesParams) SetProjectid(v string) { return } +func (p *ListPublicIpAddressesParams) SetState(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["state"] = v + return +} + func (p *ListPublicIpAddressesParams) SetTags(v map[string]string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -729,7 +740,7 @@ func (s *AddressService) NewUpdateIpAddressParams(id string) *UpdateIpAddressPar return p } -// Updates an ip address +// Updates an IP address func (s *AddressService) UpdateIpAddress(p *UpdateIpAddressParams) (*UpdateIpAddressResponse, error) { resp, err := s.cs.newRequest("updateIpAddress", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AffinityGroupService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AffinityGroupService.go index fd3630590..92fd5dcdb 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AffinityGroupService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AffinityGroupService.go @@ -45,6 +45,9 @@ func (p *CreateAffinityGroupParams) toURLValues() url.Values { if v, found := p.p["name"]; found { u.Set("name", v.(string)) } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } if v, found := p.p["type"]; found { u.Set("type", v.(string)) } @@ -83,6 +86,14 @@ func (p *CreateAffinityGroupParams) SetName(v string) { return } +func (p *CreateAffinityGroupParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + func (p *CreateAffinityGroupParams) SetType(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -143,6 +154,8 @@ type CreateAffinityGroupResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } @@ -168,6 +181,9 @@ func (p *DeleteAffinityGroupParams) toURLValues() url.Values { if v, found := p.p["name"]; found { u.Set("name", v.(string)) } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } return u } @@ -203,6 +219,14 @@ func (p *DeleteAffinityGroupParams) SetName(v string) { return } +func (p *DeleteAffinityGroupParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + // You should always use this function to get a new DeleteAffinityGroupParams instance, // as then you are sure you have configured all required params func (s *AffinityGroupService) NewDeleteAffinityGroupParams() *DeleteAffinityGroupParams { @@ -286,6 +310,9 @@ func (p *ListAffinityGroupsParams) toURLValues() url.Values { vv := strconv.Itoa(v.(int)) u.Set("pagesize", vv) } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } if v, found := p.p["type"]; found { u.Set("type", v.(string)) } @@ -367,6 +394,14 @@ func (p *ListAffinityGroupsParams) SetPagesize(v int) { return } +func (p *ListAffinityGroupsParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + func (p *ListAffinityGroupsParams) SetType(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -403,6 +438,16 @@ func (s *AffinityGroupService) GetAffinityGroupID(name string) (string, error) { return "", err } + if l.Count == 0 { + // If no matches, search all projects + p.p["projectid"] = "-1" + + l, err = s.ListAffinityGroups(p) + if err != nil { + return "", err + } + } + if l.Count == 0 { return "", fmt.Errorf("No match found for %s: %+v", name, l) } @@ -452,6 +497,21 @@ func (s *AffinityGroupService) GetAffinityGroupByID(id string) (*AffinityGroup, return nil, -1, err } + if l.Count == 0 { + // If no matches, search all projects + p.p["projectid"] = "-1" + + l, err = s.ListAffinityGroups(p) + if err != nil { + if strings.Contains(err.Error(), fmt.Sprintf( + "Invalid parameter id value=%s due to incorrect long value format, "+ + "or entity does not exist", id)) { + return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l) + } + return nil, -1, err + } + } + if l.Count == 0 { return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l) } @@ -488,6 +548,8 @@ type AffinityGroup struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } @@ -592,6 +654,8 @@ type UpdateVMAffinityGroupResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -728,6 +792,8 @@ type UpdateVMAffinityGroupResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -748,6 +814,8 @@ type UpdateVMAffinityGroupResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/AuthenticationService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AuthenticationService.go new file mode 100644 index 000000000..6839870f7 --- /dev/null +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/AuthenticationService.go @@ -0,0 +1,156 @@ +// +// Copyright 2014, Sander van Harmelen +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package cloudstack + +import ( + "encoding/json" + "net/url" + "strconv" +) + +type LoginParams struct { + p map[string]interface{} +} + +func (p *LoginParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["domain"]; found { + u.Set("domain", v.(string)) + } + if v, found := p.p["domainId"]; found { + vv := strconv.FormatInt(v.(int64), 10) + u.Set("domainId", vv) + } + if v, found := p.p["password"]; found { + u.Set("password", v.(string)) + } + if v, found := p.p["username"]; found { + u.Set("username", v.(string)) + } + return u +} + +func (p *LoginParams) SetDomain(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domain"] = v + return +} + +func (p *LoginParams) SetDomainId(v int64) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domainId"] = v + return +} + +func (p *LoginParams) SetPassword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["password"] = v + return +} + +func (p *LoginParams) SetUsername(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["username"] = v + return +} + +// You should always use this function to get a new LoginParams instance, +// as then you are sure you have configured all required params +func (s *AuthenticationService) NewLoginParams(password string, username string) *LoginParams { + p := &LoginParams{} + p.p = make(map[string]interface{}) + p.p["password"] = password + p.p["username"] = username + return p +} + +// Logs a user into the CloudStack. A successful login attempt will generate a JSESSIONID cookie value that can be passed in subsequent Query command calls until the "logout" command has been issued or the session has expired. +func (s *AuthenticationService) Login(p *LoginParams) (*LoginResponse, error) { + resp, err := s.cs.newRequest("login", p.toURLValues()) + if err != nil { + return nil, err + } + + var r LoginResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type LoginResponse struct { + Account string `json:"account,omitempty"` + Domainid string `json:"domainid,omitempty"` + Firstname string `json:"firstname,omitempty"` + Lastname string `json:"lastname,omitempty"` + Registered string `json:"registered,omitempty"` + Sessionkey string `json:"sessionkey,omitempty"` + Timeout int `json:"timeout,omitempty"` + Timezone string `json:"timezone,omitempty"` + Type string `json:"type,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` +} + +type LogoutParams struct { + p map[string]interface{} +} + +func (p *LogoutParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + return u +} + +// You should always use this function to get a new LogoutParams instance, +// as then you are sure you have configured all required params +func (s *AuthenticationService) NewLogoutParams() *LogoutParams { + p := &LogoutParams{} + p.p = make(map[string]interface{}) + return p +} + +// Logs out the user +func (s *AuthenticationService) Logout(p *LogoutParams) (*LogoutResponse, error) { + resp, err := s.cs.newRequest("logout", p.toURLValues()) + if err != nil { + return nil, err + } + + var r LogoutResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type LogoutResponse struct { + Description string `json:"description,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/BaremetalService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/BaremetalService.go index a37aa1c60..5d3f8976e 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/BaremetalService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/BaremetalService.go @@ -504,6 +504,9 @@ func (p *ListBaremetalDhcpParams) toURLValues() url.Values { vv := strconv.Itoa(v.(int)) u.Set("pagesize", vv) } + if v, found := p.p["physicalnetworkid"]; found { + u.Set("physicalnetworkid", v.(string)) + } return u } @@ -547,11 +550,20 @@ func (p *ListBaremetalDhcpParams) SetPagesize(v int) { return } +func (p *ListBaremetalDhcpParams) SetPhysicalnetworkid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["physicalnetworkid"] = v + return +} + // You should always use this function to get a new ListBaremetalDhcpParams instance, // as then you are sure you have configured all required params -func (s *BaremetalService) NewListBaremetalDhcpParams() *ListBaremetalDhcpParams { +func (s *BaremetalService) NewListBaremetalDhcpParams(physicalnetworkid string) *ListBaremetalDhcpParams { p := &ListBaremetalDhcpParams{} p.p = make(map[string]interface{}) + p.p["physicalnetworkid"] = physicalnetworkid return p } @@ -606,6 +618,9 @@ func (p *ListBaremetalPxeServersParams) toURLValues() url.Values { vv := strconv.Itoa(v.(int)) u.Set("pagesize", vv) } + if v, found := p.p["physicalnetworkid"]; found { + u.Set("physicalnetworkid", v.(string)) + } return u } @@ -641,11 +656,20 @@ func (p *ListBaremetalPxeServersParams) SetPagesize(v int) { return } +func (p *ListBaremetalPxeServersParams) SetPhysicalnetworkid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["physicalnetworkid"] = v + return +} + // You should always use this function to get a new ListBaremetalPxeServersParams instance, // as then you are sure you have configured all required params -func (s *BaremetalService) NewListBaremetalPxeServersParams() *ListBaremetalPxeServersParams { +func (s *BaremetalService) NewListBaremetalPxeServersParams(physicalnetworkid string) *ListBaremetalPxeServersParams { p := &ListBaremetalPxeServersParams{} p.p = make(map[string]interface{}) + p.p["physicalnetworkid"] = physicalnetworkid return p } @@ -674,3 +698,221 @@ type BaremetalPxeServer struct { Provider string `json:"provider,omitempty"` Url string `json:"url,omitempty"` } + +type AddBaremetalRctParams struct { + p map[string]interface{} +} + +func (p *AddBaremetalRctParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["baremetalrcturl"]; found { + u.Set("baremetalrcturl", v.(string)) + } + return u +} + +func (p *AddBaremetalRctParams) SetBaremetalrcturl(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["baremetalrcturl"] = v + return +} + +// You should always use this function to get a new AddBaremetalRctParams instance, +// as then you are sure you have configured all required params +func (s *BaremetalService) NewAddBaremetalRctParams(baremetalrcturl string) *AddBaremetalRctParams { + p := &AddBaremetalRctParams{} + p.p = make(map[string]interface{}) + p.p["baremetalrcturl"] = baremetalrcturl + return p +} + +// adds baremetal rack configuration text +func (s *BaremetalService) AddBaremetalRct(p *AddBaremetalRctParams) (*AddBaremetalRctResponse, error) { + resp, err := s.cs.newRequest("addBaremetalRct", p.toURLValues()) + if err != nil { + return nil, err + } + + var r AddBaremetalRctResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + b, err = getRawValue(b) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type AddBaremetalRctResponse struct { + JobID string `json:"jobid,omitempty"` + Id string `json:"id,omitempty"` + Url string `json:"url,omitempty"` +} + +type DeleteBaremetalRctParams struct { + p map[string]interface{} +} + +func (p *DeleteBaremetalRctParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["id"]; found { + u.Set("id", v.(string)) + } + return u +} + +func (p *DeleteBaremetalRctParams) SetId(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["id"] = v + return +} + +// You should always use this function to get a new DeleteBaremetalRctParams instance, +// as then you are sure you have configured all required params +func (s *BaremetalService) NewDeleteBaremetalRctParams(id string) *DeleteBaremetalRctParams { + p := &DeleteBaremetalRctParams{} + p.p = make(map[string]interface{}) + p.p["id"] = id + return p +} + +// deletes baremetal rack configuration text +func (s *BaremetalService) DeleteBaremetalRct(p *DeleteBaremetalRctParams) (*DeleteBaremetalRctResponse, error) { + resp, err := s.cs.newRequest("deleteBaremetalRct", p.toURLValues()) + if err != nil { + return nil, err + } + + var r DeleteBaremetalRctResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type DeleteBaremetalRctResponse struct { + JobID string `json:"jobid,omitempty"` + Displaytext string `json:"displaytext,omitempty"` + Success bool `json:"success,omitempty"` +} + +type ListBaremetalRctParams struct { + p map[string]interface{} +} + +func (p *ListBaremetalRctParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["keyword"]; found { + u.Set("keyword", v.(string)) + } + if v, found := p.p["page"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("page", vv) + } + if v, found := p.p["pagesize"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("pagesize", vv) + } + return u +} + +func (p *ListBaremetalRctParams) SetKeyword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["keyword"] = v + return +} + +func (p *ListBaremetalRctParams) SetPage(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["page"] = v + return +} + +func (p *ListBaremetalRctParams) SetPagesize(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["pagesize"] = v + return +} + +// You should always use this function to get a new ListBaremetalRctParams instance, +// as then you are sure you have configured all required params +func (s *BaremetalService) NewListBaremetalRctParams() *ListBaremetalRctParams { + p := &ListBaremetalRctParams{} + p.p = make(map[string]interface{}) + return p +} + +// list baremetal rack configuration +func (s *BaremetalService) ListBaremetalRct(p *ListBaremetalRctParams) (*ListBaremetalRctResponse, error) { + resp, err := s.cs.newRequest("listBaremetalRct", p.toURLValues()) + if err != nil { + return nil, err + } + + var r ListBaremetalRctResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type ListBaremetalRctResponse struct { + Count int `json:"count"` + BaremetalRct []*BaremetalRct `json:"baremetalrct"` +} + +type BaremetalRct struct { + Id string `json:"id,omitempty"` + Url string `json:"url,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/BigSwitchVNSService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/BigSwitchVNSService.go deleted file mode 100644 index f6bc55106..000000000 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/BigSwitchVNSService.go +++ /dev/null @@ -1,281 +0,0 @@ -// -// Copyright 2014, Sander van Harmelen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package cloudstack - -import ( - "encoding/json" - "net/url" - "strconv" -) - -type AddBigSwitchVnsDeviceParams struct { - p map[string]interface{} -} - -func (p *AddBigSwitchVnsDeviceParams) toURLValues() url.Values { - u := url.Values{} - if p.p == nil { - return u - } - if v, found := p.p["hostname"]; found { - u.Set("hostname", v.(string)) - } - if v, found := p.p["physicalnetworkid"]; found { - u.Set("physicalnetworkid", v.(string)) - } - return u -} - -func (p *AddBigSwitchVnsDeviceParams) SetHostname(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["hostname"] = v - return -} - -func (p *AddBigSwitchVnsDeviceParams) SetPhysicalnetworkid(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["physicalnetworkid"] = v - return -} - -// You should always use this function to get a new AddBigSwitchVnsDeviceParams instance, -// as then you are sure you have configured all required params -func (s *BigSwitchVNSService) NewAddBigSwitchVnsDeviceParams(hostname string, physicalnetworkid string) *AddBigSwitchVnsDeviceParams { - p := &AddBigSwitchVnsDeviceParams{} - p.p = make(map[string]interface{}) - p.p["hostname"] = hostname - p.p["physicalnetworkid"] = physicalnetworkid - return p -} - -// Adds a BigSwitch VNS device -func (s *BigSwitchVNSService) AddBigSwitchVnsDevice(p *AddBigSwitchVnsDeviceParams) (*AddBigSwitchVnsDeviceResponse, error) { - resp, err := s.cs.newRequest("addBigSwitchVnsDevice", p.toURLValues()) - if err != nil { - return nil, err - } - - var r AddBigSwitchVnsDeviceResponse - if err := json.Unmarshal(resp, &r); err != nil { - return nil, err - } - - // If we have a async client, we need to wait for the async result - if s.cs.async { - b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) - if err != nil { - if err == AsyncTimeoutErr { - return &r, err - } - return nil, err - } - - b, err = getRawValue(b) - if err != nil { - return nil, err - } - - if err := json.Unmarshal(b, &r); err != nil { - return nil, err - } - } - return &r, nil -} - -type AddBigSwitchVnsDeviceResponse struct { - JobID string `json:"jobid,omitempty"` - Bigswitchdevicename string `json:"bigswitchdevicename,omitempty"` - Hostname string `json:"hostname,omitempty"` - Physicalnetworkid string `json:"physicalnetworkid,omitempty"` - Provider string `json:"provider,omitempty"` - Vnsdeviceid string `json:"vnsdeviceid,omitempty"` -} - -type DeleteBigSwitchVnsDeviceParams struct { - p map[string]interface{} -} - -func (p *DeleteBigSwitchVnsDeviceParams) toURLValues() url.Values { - u := url.Values{} - if p.p == nil { - return u - } - if v, found := p.p["vnsdeviceid"]; found { - u.Set("vnsdeviceid", v.(string)) - } - return u -} - -func (p *DeleteBigSwitchVnsDeviceParams) SetVnsdeviceid(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["vnsdeviceid"] = v - return -} - -// You should always use this function to get a new DeleteBigSwitchVnsDeviceParams instance, -// as then you are sure you have configured all required params -func (s *BigSwitchVNSService) NewDeleteBigSwitchVnsDeviceParams(vnsdeviceid string) *DeleteBigSwitchVnsDeviceParams { - p := &DeleteBigSwitchVnsDeviceParams{} - p.p = make(map[string]interface{}) - p.p["vnsdeviceid"] = vnsdeviceid - return p -} - -// delete a bigswitch vns device -func (s *BigSwitchVNSService) DeleteBigSwitchVnsDevice(p *DeleteBigSwitchVnsDeviceParams) (*DeleteBigSwitchVnsDeviceResponse, error) { - resp, err := s.cs.newRequest("deleteBigSwitchVnsDevice", p.toURLValues()) - if err != nil { - return nil, err - } - - var r DeleteBigSwitchVnsDeviceResponse - if err := json.Unmarshal(resp, &r); err != nil { - return nil, err - } - - // If we have a async client, we need to wait for the async result - if s.cs.async { - b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) - if err != nil { - if err == AsyncTimeoutErr { - return &r, err - } - return nil, err - } - - if err := json.Unmarshal(b, &r); err != nil { - return nil, err - } - } - return &r, nil -} - -type DeleteBigSwitchVnsDeviceResponse struct { - JobID string `json:"jobid,omitempty"` - Displaytext string `json:"displaytext,omitempty"` - Success bool `json:"success,omitempty"` -} - -type ListBigSwitchVnsDevicesParams struct { - p map[string]interface{} -} - -func (p *ListBigSwitchVnsDevicesParams) toURLValues() url.Values { - u := url.Values{} - if p.p == nil { - return u - } - if v, found := p.p["keyword"]; found { - u.Set("keyword", v.(string)) - } - if v, found := p.p["page"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("page", vv) - } - if v, found := p.p["pagesize"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("pagesize", vv) - } - if v, found := p.p["physicalnetworkid"]; found { - u.Set("physicalnetworkid", v.(string)) - } - if v, found := p.p["vnsdeviceid"]; found { - u.Set("vnsdeviceid", v.(string)) - } - return u -} - -func (p *ListBigSwitchVnsDevicesParams) SetKeyword(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["keyword"] = v - return -} - -func (p *ListBigSwitchVnsDevicesParams) SetPage(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["page"] = v - return -} - -func (p *ListBigSwitchVnsDevicesParams) SetPagesize(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["pagesize"] = v - return -} - -func (p *ListBigSwitchVnsDevicesParams) SetPhysicalnetworkid(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["physicalnetworkid"] = v - return -} - -func (p *ListBigSwitchVnsDevicesParams) SetVnsdeviceid(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["vnsdeviceid"] = v - return -} - -// You should always use this function to get a new ListBigSwitchVnsDevicesParams instance, -// as then you are sure you have configured all required params -func (s *BigSwitchVNSService) NewListBigSwitchVnsDevicesParams() *ListBigSwitchVnsDevicesParams { - p := &ListBigSwitchVnsDevicesParams{} - p.p = make(map[string]interface{}) - return p -} - -// Lists BigSwitch Vns devices -func (s *BigSwitchVNSService) ListBigSwitchVnsDevices(p *ListBigSwitchVnsDevicesParams) (*ListBigSwitchVnsDevicesResponse, error) { - resp, err := s.cs.newRequest("listBigSwitchVnsDevices", p.toURLValues()) - if err != nil { - return nil, err - } - - var r ListBigSwitchVnsDevicesResponse - if err := json.Unmarshal(resp, &r); err != nil { - return nil, err - } - return &r, nil -} - -type ListBigSwitchVnsDevicesResponse struct { - Count int `json:"count"` - BigSwitchVnsDevices []*BigSwitchVnsDevice `json:"bigswitchvnsdevice"` -} - -type BigSwitchVnsDevice struct { - Bigswitchdevicename string `json:"bigswitchdevicename,omitempty"` - Hostname string `json:"hostname,omitempty"` - Physicalnetworkid string `json:"physicalnetworkid,omitempty"` - Provider string `json:"provider,omitempty"` - Vnsdeviceid string `json:"vnsdeviceid,omitempty"` -} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ClusterService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ClusterService.go index 24d0214ee..c9c346e8a 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ClusterService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ClusterService.go @@ -51,6 +51,15 @@ func (p *AddClusterParams) toURLValues() url.Values { if v, found := p.p["hypervisor"]; found { u.Set("hypervisor", v.(string)) } + if v, found := p.p["ovm3cluster"]; found { + u.Set("ovm3cluster", v.(string)) + } + if v, found := p.p["ovm3pool"]; found { + u.Set("ovm3pool", v.(string)) + } + if v, found := p.p["ovm3vip"]; found { + u.Set("ovm3vip", v.(string)) + } if v, found := p.p["password"]; found { u.Set("password", v.(string)) } @@ -132,6 +141,30 @@ func (p *AddClusterParams) SetHypervisor(v string) { return } +func (p *AddClusterParams) SetOvm3cluster(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ovm3cluster"] = v + return +} + +func (p *AddClusterParams) SetOvm3pool(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ovm3pool"] = v + return +} + +func (p *AddClusterParams) SetOvm3vip(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ovm3vip"] = v + return +} + func (p *AddClusterParams) SetPassword(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -260,6 +293,7 @@ type AddClusterResponse struct { Managedstate string `json:"managedstate,omitempty"` Memoryovercommitratio string `json:"memoryovercommitratio,omitempty"` Name string `json:"name,omitempty"` + Ovm3vip string `json:"ovm3vip,omitempty"` Podid string `json:"podid,omitempty"` Podname string `json:"podname,omitempty"` Zoneid string `json:"zoneid,omitempty"` @@ -439,6 +473,7 @@ type UpdateClusterResponse struct { Managedstate string `json:"managedstate,omitempty"` Memoryovercommitratio string `json:"memoryovercommitratio,omitempty"` Name string `json:"name,omitempty"` + Ovm3vip string `json:"ovm3vip,omitempty"` Podid string `json:"podid,omitempty"` Podname string `json:"podname,omitempty"` Zoneid string `json:"zoneid,omitempty"` @@ -711,6 +746,7 @@ type Cluster struct { Managedstate string `json:"managedstate,omitempty"` Memoryovercommitratio string `json:"memoryovercommitratio,omitempty"` Name string `json:"name,omitempty"` + Ovm3vip string `json:"ovm3vip,omitempty"` Podid string `json:"podid,omitempty"` Podname string `json:"podname,omitempty"` Zoneid string `json:"zoneid,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ConfigurationService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ConfigurationService.go index d4a2f55d7..af9f46a34 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ConfigurationService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ConfigurationService.go @@ -322,6 +322,8 @@ type ListCapabilitiesResponse struct { type Capability struct { Allowusercreateprojects bool `json:"allowusercreateprojects,omitempty"` + Allowuserexpungerecovervm bool `json:"allowuserexpungerecovervm,omitempty"` + Allowuserviewdestroyedvm bool `json:"allowuserviewdestroyedvm,omitempty"` Apilimitinterval int `json:"apilimitinterval,omitempty"` Apilimitmax int `json:"apilimitmax,omitempty"` Cloudstackversion string `json:"cloudstackversion,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/DiskOfferingService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/DiskOfferingService.go index e97c784f8..72f781afe 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/DiskOfferingService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/DiskOfferingService.go @@ -86,6 +86,9 @@ func (p *CreateDiskOfferingParams) toURLValues() url.Values { if v, found := p.p["name"]; found { u.Set("name", v.(string)) } + if v, found := p.p["provisioningtype"]; found { + u.Set("provisioningtype", v.(string)) + } if v, found := p.p["storagetype"]; found { u.Set("storagetype", v.(string)) } @@ -207,6 +210,14 @@ func (p *CreateDiskOfferingParams) SetName(v string) { return } +func (p *CreateDiskOfferingParams) SetProvisioningtype(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["provisioningtype"] = v + return +} + func (p *CreateDiskOfferingParams) SetStoragetype(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -266,6 +277,7 @@ type CreateDiskOfferingResponse struct { Maxiops int64 `json:"maxiops,omitempty"` Miniops int64 `json:"miniops,omitempty"` Name string `json:"name,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Storagetype string `json:"storagetype,omitempty"` Tags string `json:"tags,omitempty"` } @@ -381,6 +393,7 @@ type UpdateDiskOfferingResponse struct { Maxiops int64 `json:"maxiops,omitempty"` Miniops int64 `json:"miniops,omitempty"` Name string `json:"name,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Storagetype string `json:"storagetype,omitempty"` Tags string `json:"tags,omitempty"` } @@ -451,9 +464,17 @@ func (p *ListDiskOfferingsParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } + if v, found := p.p["isrecursive"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isrecursive", vv) + } if v, found := p.p["keyword"]; found { u.Set("keyword", v.(string)) } + if v, found := p.p["listall"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("listall", vv) + } if v, found := p.p["name"]; found { u.Set("name", v.(string)) } @@ -484,6 +505,14 @@ func (p *ListDiskOfferingsParams) SetId(v string) { return } +func (p *ListDiskOfferingsParams) SetIsrecursive(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isrecursive"] = v + return +} + func (p *ListDiskOfferingsParams) SetKeyword(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -492,6 +521,14 @@ func (p *ListDiskOfferingsParams) SetKeyword(v string) { return } +func (p *ListDiskOfferingsParams) SetListall(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["listall"] = v + return +} + func (p *ListDiskOfferingsParams) SetName(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -633,6 +670,7 @@ type DiskOffering struct { Maxiops int64 `json:"maxiops,omitempty"` Miniops int64 `json:"miniops,omitempty"` Name string `json:"name,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Storagetype string `json:"storagetype,omitempty"` Tags string `json:"tags,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/DomainService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/DomainService.go index 883976499..21595ed4c 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/DomainService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/DomainService.go @@ -104,14 +104,51 @@ func (s *DomainService) CreateDomain(p *CreateDomainParams) (*CreateDomainRespon } type CreateDomainResponse struct { - Haschild bool `json:"haschild,omitempty"` - Id string `json:"id,omitempty"` - Level int `json:"level,omitempty"` - Name string `json:"name,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Parentdomainid string `json:"parentdomainid,omitempty"` - Parentdomainname string `json:"parentdomainname,omitempty"` - Path string `json:"path,omitempty"` + Cpuavailable string `json:"cpuavailable,omitempty"` + Cpulimit string `json:"cpulimit,omitempty"` + Cputotal int64 `json:"cputotal,omitempty"` + Haschild bool `json:"haschild,omitempty"` + Id string `json:"id,omitempty"` + Ipavailable string `json:"ipavailable,omitempty"` + Iplimit string `json:"iplimit,omitempty"` + Iptotal int64 `json:"iptotal,omitempty"` + Level int `json:"level,omitempty"` + Memoryavailable string `json:"memoryavailable,omitempty"` + Memorylimit string `json:"memorylimit,omitempty"` + Memorytotal int64 `json:"memorytotal,omitempty"` + Name string `json:"name,omitempty"` + Networkavailable string `json:"networkavailable,omitempty"` + Networkdomain string `json:"networkdomain,omitempty"` + Networklimit string `json:"networklimit,omitempty"` + Networktotal int64 `json:"networktotal,omitempty"` + Parentdomainid string `json:"parentdomainid,omitempty"` + Parentdomainname string `json:"parentdomainname,omitempty"` + Path string `json:"path,omitempty"` + Primarystorageavailable string `json:"primarystorageavailable,omitempty"` + Primarystoragelimit string `json:"primarystoragelimit,omitempty"` + Primarystoragetotal int64 `json:"primarystoragetotal,omitempty"` + Projectavailable string `json:"projectavailable,omitempty"` + Projectlimit string `json:"projectlimit,omitempty"` + Projecttotal int64 `json:"projecttotal,omitempty"` + Secondarystorageavailable string `json:"secondarystorageavailable,omitempty"` + Secondarystoragelimit string `json:"secondarystoragelimit,omitempty"` + Secondarystoragetotal int64 `json:"secondarystoragetotal,omitempty"` + Snapshotavailable string `json:"snapshotavailable,omitempty"` + Snapshotlimit string `json:"snapshotlimit,omitempty"` + Snapshottotal int64 `json:"snapshottotal,omitempty"` + State string `json:"state,omitempty"` + Templateavailable string `json:"templateavailable,omitempty"` + Templatelimit string `json:"templatelimit,omitempty"` + Templatetotal int64 `json:"templatetotal,omitempty"` + Vmavailable string `json:"vmavailable,omitempty"` + Vmlimit string `json:"vmlimit,omitempty"` + Vmtotal int64 `json:"vmtotal,omitempty"` + Volumeavailable string `json:"volumeavailable,omitempty"` + Volumelimit string `json:"volumelimit,omitempty"` + Volumetotal int64 `json:"volumetotal,omitempty"` + Vpcavailable string `json:"vpcavailable,omitempty"` + Vpclimit string `json:"vpclimit,omitempty"` + Vpctotal int64 `json:"vpctotal,omitempty"` } type UpdateDomainParams struct { @@ -183,14 +220,51 @@ func (s *DomainService) UpdateDomain(p *UpdateDomainParams) (*UpdateDomainRespon } type UpdateDomainResponse struct { - Haschild bool `json:"haschild,omitempty"` - Id string `json:"id,omitempty"` - Level int `json:"level,omitempty"` - Name string `json:"name,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Parentdomainid string `json:"parentdomainid,omitempty"` - Parentdomainname string `json:"parentdomainname,omitempty"` - Path string `json:"path,omitempty"` + Cpuavailable string `json:"cpuavailable,omitempty"` + Cpulimit string `json:"cpulimit,omitempty"` + Cputotal int64 `json:"cputotal,omitempty"` + Haschild bool `json:"haschild,omitempty"` + Id string `json:"id,omitempty"` + Ipavailable string `json:"ipavailable,omitempty"` + Iplimit string `json:"iplimit,omitempty"` + Iptotal int64 `json:"iptotal,omitempty"` + Level int `json:"level,omitempty"` + Memoryavailable string `json:"memoryavailable,omitempty"` + Memorylimit string `json:"memorylimit,omitempty"` + Memorytotal int64 `json:"memorytotal,omitempty"` + Name string `json:"name,omitempty"` + Networkavailable string `json:"networkavailable,omitempty"` + Networkdomain string `json:"networkdomain,omitempty"` + Networklimit string `json:"networklimit,omitempty"` + Networktotal int64 `json:"networktotal,omitempty"` + Parentdomainid string `json:"parentdomainid,omitempty"` + Parentdomainname string `json:"parentdomainname,omitempty"` + Path string `json:"path,omitempty"` + Primarystorageavailable string `json:"primarystorageavailable,omitempty"` + Primarystoragelimit string `json:"primarystoragelimit,omitempty"` + Primarystoragetotal int64 `json:"primarystoragetotal,omitempty"` + Projectavailable string `json:"projectavailable,omitempty"` + Projectlimit string `json:"projectlimit,omitempty"` + Projecttotal int64 `json:"projecttotal,omitempty"` + Secondarystorageavailable string `json:"secondarystorageavailable,omitempty"` + Secondarystoragelimit string `json:"secondarystoragelimit,omitempty"` + Secondarystoragetotal int64 `json:"secondarystoragetotal,omitempty"` + Snapshotavailable string `json:"snapshotavailable,omitempty"` + Snapshotlimit string `json:"snapshotlimit,omitempty"` + Snapshottotal int64 `json:"snapshottotal,omitempty"` + State string `json:"state,omitempty"` + Templateavailable string `json:"templateavailable,omitempty"` + Templatelimit string `json:"templatelimit,omitempty"` + Templatetotal int64 `json:"templatetotal,omitempty"` + Vmavailable string `json:"vmavailable,omitempty"` + Vmlimit string `json:"vmlimit,omitempty"` + Vmtotal int64 `json:"vmtotal,omitempty"` + Volumeavailable string `json:"volumeavailable,omitempty"` + Volumelimit string `json:"volumelimit,omitempty"` + Volumetotal int64 `json:"volumetotal,omitempty"` + Vpcavailable string `json:"vpcavailable,omitempty"` + Vpclimit string `json:"vpclimit,omitempty"` + Vpctotal int64 `json:"vpctotal,omitempty"` } type DeleteDomainParams struct { @@ -464,14 +538,51 @@ type ListDomainsResponse struct { } type Domain struct { - Haschild bool `json:"haschild,omitempty"` - Id string `json:"id,omitempty"` - Level int `json:"level,omitempty"` - Name string `json:"name,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Parentdomainid string `json:"parentdomainid,omitempty"` - Parentdomainname string `json:"parentdomainname,omitempty"` - Path string `json:"path,omitempty"` + Cpuavailable string `json:"cpuavailable,omitempty"` + Cpulimit string `json:"cpulimit,omitempty"` + Cputotal int64 `json:"cputotal,omitempty"` + Haschild bool `json:"haschild,omitempty"` + Id string `json:"id,omitempty"` + Ipavailable string `json:"ipavailable,omitempty"` + Iplimit string `json:"iplimit,omitempty"` + Iptotal int64 `json:"iptotal,omitempty"` + Level int `json:"level,omitempty"` + Memoryavailable string `json:"memoryavailable,omitempty"` + Memorylimit string `json:"memorylimit,omitempty"` + Memorytotal int64 `json:"memorytotal,omitempty"` + Name string `json:"name,omitempty"` + Networkavailable string `json:"networkavailable,omitempty"` + Networkdomain string `json:"networkdomain,omitempty"` + Networklimit string `json:"networklimit,omitempty"` + Networktotal int64 `json:"networktotal,omitempty"` + Parentdomainid string `json:"parentdomainid,omitempty"` + Parentdomainname string `json:"parentdomainname,omitempty"` + Path string `json:"path,omitempty"` + Primarystorageavailable string `json:"primarystorageavailable,omitempty"` + Primarystoragelimit string `json:"primarystoragelimit,omitempty"` + Primarystoragetotal int64 `json:"primarystoragetotal,omitempty"` + Projectavailable string `json:"projectavailable,omitempty"` + Projectlimit string `json:"projectlimit,omitempty"` + Projecttotal int64 `json:"projecttotal,omitempty"` + Secondarystorageavailable string `json:"secondarystorageavailable,omitempty"` + Secondarystoragelimit string `json:"secondarystoragelimit,omitempty"` + Secondarystoragetotal int64 `json:"secondarystoragetotal,omitempty"` + Snapshotavailable string `json:"snapshotavailable,omitempty"` + Snapshotlimit string `json:"snapshotlimit,omitempty"` + Snapshottotal int64 `json:"snapshottotal,omitempty"` + State string `json:"state,omitempty"` + Templateavailable string `json:"templateavailable,omitempty"` + Templatelimit string `json:"templatelimit,omitempty"` + Templatetotal int64 `json:"templatetotal,omitempty"` + Vmavailable string `json:"vmavailable,omitempty"` + Vmlimit string `json:"vmlimit,omitempty"` + Vmtotal int64 `json:"vmtotal,omitempty"` + Volumeavailable string `json:"volumeavailable,omitempty"` + Volumelimit string `json:"volumelimit,omitempty"` + Volumetotal int64 `json:"volumetotal,omitempty"` + Vpcavailable string `json:"vpcavailable,omitempty"` + Vpclimit string `json:"vpclimit,omitempty"` + Vpctotal int64 `json:"vpctotal,omitempty"` } type ListDomainChildrenParams struct { @@ -666,12 +777,151 @@ type ListDomainChildrenResponse struct { } type DomainChildren struct { - Haschild bool `json:"haschild,omitempty"` - Id string `json:"id,omitempty"` - Level int `json:"level,omitempty"` - Name string `json:"name,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Parentdomainid string `json:"parentdomainid,omitempty"` - Parentdomainname string `json:"parentdomainname,omitempty"` - Path string `json:"path,omitempty"` + Cpuavailable string `json:"cpuavailable,omitempty"` + Cpulimit string `json:"cpulimit,omitempty"` + Cputotal int64 `json:"cputotal,omitempty"` + Haschild bool `json:"haschild,omitempty"` + Id string `json:"id,omitempty"` + Ipavailable string `json:"ipavailable,omitempty"` + Iplimit string `json:"iplimit,omitempty"` + Iptotal int64 `json:"iptotal,omitempty"` + Level int `json:"level,omitempty"` + Memoryavailable string `json:"memoryavailable,omitempty"` + Memorylimit string `json:"memorylimit,omitempty"` + Memorytotal int64 `json:"memorytotal,omitempty"` + Name string `json:"name,omitempty"` + Networkavailable string `json:"networkavailable,omitempty"` + Networkdomain string `json:"networkdomain,omitempty"` + Networklimit string `json:"networklimit,omitempty"` + Networktotal int64 `json:"networktotal,omitempty"` + Parentdomainid string `json:"parentdomainid,omitempty"` + Parentdomainname string `json:"parentdomainname,omitempty"` + Path string `json:"path,omitempty"` + Primarystorageavailable string `json:"primarystorageavailable,omitempty"` + Primarystoragelimit string `json:"primarystoragelimit,omitempty"` + Primarystoragetotal int64 `json:"primarystoragetotal,omitempty"` + Projectavailable string `json:"projectavailable,omitempty"` + Projectlimit string `json:"projectlimit,omitempty"` + Projecttotal int64 `json:"projecttotal,omitempty"` + Secondarystorageavailable string `json:"secondarystorageavailable,omitempty"` + Secondarystoragelimit string `json:"secondarystoragelimit,omitempty"` + Secondarystoragetotal int64 `json:"secondarystoragetotal,omitempty"` + Snapshotavailable string `json:"snapshotavailable,omitempty"` + Snapshotlimit string `json:"snapshotlimit,omitempty"` + Snapshottotal int64 `json:"snapshottotal,omitempty"` + State string `json:"state,omitempty"` + Templateavailable string `json:"templateavailable,omitempty"` + Templatelimit string `json:"templatelimit,omitempty"` + Templatetotal int64 `json:"templatetotal,omitempty"` + Vmavailable string `json:"vmavailable,omitempty"` + Vmlimit string `json:"vmlimit,omitempty"` + Vmtotal int64 `json:"vmtotal,omitempty"` + Volumeavailable string `json:"volumeavailable,omitempty"` + Volumelimit string `json:"volumelimit,omitempty"` + Volumetotal int64 `json:"volumetotal,omitempty"` + Vpcavailable string `json:"vpcavailable,omitempty"` + Vpclimit string `json:"vpclimit,omitempty"` + Vpctotal int64 `json:"vpctotal,omitempty"` +} + +type LinkDomainToLdapParams struct { + p map[string]interface{} +} + +func (p *LinkDomainToLdapParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["accounttype"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("accounttype", vv) + } + if v, found := p.p["admin"]; found { + u.Set("admin", v.(string)) + } + if v, found := p.p["domainid"]; found { + u.Set("domainid", v.(string)) + } + if v, found := p.p["name"]; found { + u.Set("name", v.(string)) + } + if v, found := p.p["type"]; found { + u.Set("type", v.(string)) + } + return u +} + +func (p *LinkDomainToLdapParams) SetAccounttype(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["accounttype"] = v + return +} + +func (p *LinkDomainToLdapParams) SetAdmin(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["admin"] = v + return +} + +func (p *LinkDomainToLdapParams) SetDomainid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domainid"] = v + return +} + +func (p *LinkDomainToLdapParams) SetName(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["name"] = v + return +} + +func (p *LinkDomainToLdapParams) SetType(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domainType"] = v + return +} + +// You should always use this function to get a new LinkDomainToLdapParams instance, +// as then you are sure you have configured all required params +func (s *DomainService) NewLinkDomainToLdapParams(accounttype int, domainid string, name string, domainType string) *LinkDomainToLdapParams { + p := &LinkDomainToLdapParams{} + p.p = make(map[string]interface{}) + p.p["accounttype"] = accounttype + p.p["domainid"] = domainid + p.p["name"] = name + p.p["domainType"] = domainType + return p +} + +// link an existing cloudstack domain to group or OU in ldap +func (s *DomainService) LinkDomainToLdap(p *LinkDomainToLdapParams) (*LinkDomainToLdapResponse, error) { + resp, err := s.cs.newRequest("linkDomainToLdap", p.toURLValues()) + if err != nil { + return nil, err + } + + var r LinkDomainToLdapResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type LinkDomainToLdapResponse struct { + Accountid string `json:"accountid,omitempty"` + Accounttype int `json:"accounttype,omitempty"` + Domainid int64 `json:"domainid,omitempty"` + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/FirewallService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/FirewallService.go index 08cb56418..a544a99f7 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/FirewallService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/FirewallService.go @@ -24,6 +24,56 @@ import ( "strings" ) +// Helper function for maintaining backwards compatibility +func convertFirewallServiceResponse(b []byte) ([]byte, error) { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return nil, err + } + + if _, ok := raw["firewallrule"]; ok { + return convertFirewallServiceListResponse(b) + } + + for _, k := range []string{"endport", "startport"} { + if sVal, ok := raw[k].(string); ok { + iVal, err := strconv.Atoi(sVal) + if err != nil { + return nil, err + } + raw[k] = iVal + } + } + + return json.Marshal(raw) +} + +// Helper function for maintaining backwards compatibility +func convertFirewallServiceListResponse(b []byte) ([]byte, error) { + var rawList struct { + Count int `json:"count"` + FirewallRules []map[string]interface{} `json:"firewallrule"` + } + + if err := json.Unmarshal(b, &rawList); err != nil { + return nil, err + } + + for _, r := range rawList.FirewallRules { + for _, k := range []string{"endport", "startport"} { + if sVal, ok := r[k].(string); ok { + iVal, err := strconv.Atoi(sVal) + if err != nil { + return nil, err + } + r[k] = iVal + } + } + } + + return json.Marshal(rawList) +} + type ListPortForwardingRulesParams struct { p map[string]interface{} } @@ -246,6 +296,11 @@ func (s *FirewallService) ListPortForwardingRules(p *ListPortForwardingRulesPara return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r ListPortForwardingRulesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -460,6 +515,11 @@ func (s *FirewallService) CreatePortForwardingRule(p *CreatePortForwardingRulePa return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r CreatePortForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -480,6 +540,11 @@ func (s *FirewallService) CreatePortForwardingRule(p *CreatePortForwardingRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -558,6 +623,11 @@ func (s *FirewallService) DeletePortForwardingRule(p *DeletePortForwardingRulePa return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r DeletePortForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -573,6 +643,11 @@ func (s *FirewallService) DeletePortForwardingRule(p *DeletePortForwardingRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -605,24 +680,16 @@ func (p *UpdatePortForwardingRuleParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } - if v, found := p.p["ipaddressid"]; found { - u.Set("ipaddressid", v.(string)) - } - if v, found := p.p["privateip"]; found { - u.Set("privateip", v.(string)) - } if v, found := p.p["privateport"]; found { - u.Set("privateport", v.(string)) - } - if v, found := p.p["protocol"]; found { - u.Set("protocol", v.(string)) - } - if v, found := p.p["publicport"]; found { - u.Set("publicport", v.(string)) + vv := strconv.Itoa(v.(int)) + u.Set("privateport", vv) } if v, found := p.p["virtualmachineid"]; found { u.Set("virtualmachineid", v.(string)) } + if v, found := p.p["vmguestip"]; found { + u.Set("vmguestip", v.(string)) + } return u } @@ -650,23 +717,7 @@ func (p *UpdatePortForwardingRuleParams) SetId(v string) { return } -func (p *UpdatePortForwardingRuleParams) SetIpaddressid(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["ipaddressid"] = v - return -} - -func (p *UpdatePortForwardingRuleParams) SetPrivateip(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["privateip"] = v - return -} - -func (p *UpdatePortForwardingRuleParams) SetPrivateport(v string) { +func (p *UpdatePortForwardingRuleParams) SetPrivateport(v int) { if p.p == nil { p.p = make(map[string]interface{}) } @@ -674,22 +725,6 @@ func (p *UpdatePortForwardingRuleParams) SetPrivateport(v string) { return } -func (p *UpdatePortForwardingRuleParams) SetProtocol(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["protocol"] = v - return -} - -func (p *UpdatePortForwardingRuleParams) SetPublicport(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["publicport"] = v - return -} - func (p *UpdatePortForwardingRuleParams) SetVirtualmachineid(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -698,6 +733,14 @@ func (p *UpdatePortForwardingRuleParams) SetVirtualmachineid(v string) { return } +func (p *UpdatePortForwardingRuleParams) SetVmguestip(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["vmguestip"] = v + return +} + // You should always use this function to get a new UpdatePortForwardingRuleParams instance, // as then you are sure you have configured all required params func (s *FirewallService) NewUpdatePortForwardingRuleParams(id string) *UpdatePortForwardingRuleParams { @@ -707,13 +750,18 @@ func (s *FirewallService) NewUpdatePortForwardingRuleParams(id string) *UpdatePo return p } -// Updates a port forwarding rule. Only the private port and the virtual machine can be updated. +// Updates a port forwarding rule. Only the private port and the virtual machine can be updated. func (s *FirewallService) UpdatePortForwardingRule(p *UpdatePortForwardingRuleParams) (*UpdatePortForwardingRuleResponse, error) { resp, err := s.cs.newRequest("updatePortForwardingRule", p.toURLValues()) if err != nil { return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r UpdatePortForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -734,6 +782,11 @@ func (s *FirewallService) UpdatePortForwardingRule(p *UpdatePortForwardingRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -900,13 +953,18 @@ func (s *FirewallService) NewCreateFirewallRuleParams(ipaddressid string, protoc return p } -// Creates a firewall rule for a given ip address +// Creates a firewall rule for a given IP address func (s *FirewallService) CreateFirewallRule(p *CreateFirewallRuleParams) (*CreateFirewallRuleResponse, error) { resp, err := s.cs.newRequest("createFirewallRule", p.toURLValues()) if err != nil { return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r CreateFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -927,6 +985,11 @@ func (s *FirewallService) CreateFirewallRule(p *CreateFirewallRuleParams) (*Crea return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -937,7 +1000,7 @@ func (s *FirewallService) CreateFirewallRule(p *CreateFirewallRuleParams) (*Crea type CreateFirewallRuleResponse struct { JobID string `json:"jobid,omitempty"` Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -946,7 +1009,7 @@ type CreateFirewallRuleResponse struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -1001,6 +1064,11 @@ func (s *FirewallService) DeleteFirewallRule(p *DeleteFirewallRuleParams) (*Dele return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r DeleteFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1016,6 +1084,11 @@ func (s *FirewallService) DeleteFirewallRule(p *DeleteFirewallRuleParams) (*Dele return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -1251,6 +1324,11 @@ func (s *FirewallService) ListFirewallRules(p *ListFirewallRulesParams) (*ListFi return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r ListFirewallRulesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1265,7 +1343,7 @@ type ListFirewallRulesResponse struct { type FirewallRule struct { Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -1274,7 +1352,7 @@ type FirewallRule struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -1352,6 +1430,11 @@ func (s *FirewallService) UpdateFirewallRule(p *UpdateFirewallRuleParams) (*Upda return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r UpdateFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1372,6 +1455,11 @@ func (s *FirewallService) UpdateFirewallRule(p *UpdateFirewallRuleParams) (*Upda return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -1382,7 +1470,7 @@ func (s *FirewallService) UpdateFirewallRule(p *UpdateFirewallRuleParams) (*Upda type UpdateFirewallRuleResponse struct { JobID string `json:"jobid,omitempty"` Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -1391,7 +1479,7 @@ type UpdateFirewallRuleResponse struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -1541,6 +1629,11 @@ func (s *FirewallService) CreateEgressFirewallRule(p *CreateEgressFirewallRulePa return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r CreateEgressFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1561,6 +1654,11 @@ func (s *FirewallService) CreateEgressFirewallRule(p *CreateEgressFirewallRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -1571,7 +1669,7 @@ func (s *FirewallService) CreateEgressFirewallRule(p *CreateEgressFirewallRulePa type CreateEgressFirewallRuleResponse struct { JobID string `json:"jobid,omitempty"` Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -1580,7 +1678,7 @@ type CreateEgressFirewallRuleResponse struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -1628,13 +1726,18 @@ func (s *FirewallService) NewDeleteEgressFirewallRuleParams(id string) *DeleteEg return p } -// Deletes an ggress firewall rule +// Deletes an egress firewall rule func (s *FirewallService) DeleteEgressFirewallRule(p *DeleteEgressFirewallRuleParams) (*DeleteEgressFirewallRuleResponse, error) { resp, err := s.cs.newRequest("deleteEgressFirewallRule", p.toURLValues()) if err != nil { return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r DeleteEgressFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1650,6 +1753,11 @@ func (s *FirewallService) DeleteEgressFirewallRule(p *DeleteEgressFirewallRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -1685,9 +1793,6 @@ func (p *ListEgressFirewallRulesParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } - if v, found := p.p["id"]; found { - u.Set("id", v.(string)) - } if v, found := p.p["ipaddressid"]; found { u.Set("ipaddressid", v.(string)) } @@ -1705,9 +1810,6 @@ func (p *ListEgressFirewallRulesParams) toURLValues() url.Values { if v, found := p.p["networkid"]; found { u.Set("networkid", v.(string)) } - if v, found := p.p["networkid"]; found { - u.Set("networkid", v.(string)) - } if v, found := p.p["page"]; found { vv := strconv.Itoa(v.(int)) u.Set("page", vv) @@ -1884,13 +1986,18 @@ func (s *FirewallService) GetEgressFirewallRuleByID(id string) (*EgressFirewallR return nil, l.Count, fmt.Errorf("There is more then one result for EgressFirewallRule UUID: %s!", id) } -// Lists all egress firewall rules for network id. +// Lists all egress firewall rules for network ID. func (s *FirewallService) ListEgressFirewallRules(p *ListEgressFirewallRulesParams) (*ListEgressFirewallRulesResponse, error) { resp, err := s.cs.newRequest("listEgressFirewallRules", p.toURLValues()) if err != nil { return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r ListEgressFirewallRulesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -1905,7 +2012,7 @@ type ListEgressFirewallRulesResponse struct { type EgressFirewallRule struct { Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -1914,7 +2021,7 @@ type EgressFirewallRule struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -1992,6 +2099,11 @@ func (s *FirewallService) UpdateEgressFirewallRule(p *UpdateEgressFirewallRulePa return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r UpdateEgressFirewallRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -2012,6 +2124,11 @@ func (s *FirewallService) UpdateEgressFirewallRule(p *UpdateEgressFirewallRulePa return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -2022,7 +2139,7 @@ func (s *FirewallService) UpdateEgressFirewallRule(p *UpdateEgressFirewallRulePa type UpdateEgressFirewallRuleResponse struct { JobID string `json:"jobid,omitempty"` Cidrlist string `json:"cidrlist,omitempty"` - Endport string `json:"endport,omitempty"` + Endport int `json:"endport,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Icmpcode int `json:"icmpcode,omitempty"` Icmptype int `json:"icmptype,omitempty"` @@ -2031,7 +2148,7 @@ type UpdateEgressFirewallRuleResponse struct { Ipaddressid string `json:"ipaddressid,omitempty"` Networkid string `json:"networkid,omitempty"` Protocol string `json:"protocol,omitempty"` - Startport string `json:"startport,omitempty"` + Startport int `json:"startport,omitempty"` State string `json:"state,omitempty"` Tags []struct { Account string `json:"account,omitempty"` @@ -2134,6 +2251,11 @@ func (s *FirewallService) AddPaloAltoFirewall(p *AddPaloAltoFirewallParams) (*Ad return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r AddPaloAltoFirewallResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -2154,6 +2276,11 @@ func (s *FirewallService) AddPaloAltoFirewall(p *AddPaloAltoFirewallParams) (*Ad return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -2220,6 +2347,11 @@ func (s *FirewallService) DeletePaloAltoFirewall(p *DeletePaloAltoFirewallParams return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r DeletePaloAltoFirewallResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -2235,6 +2367,11 @@ func (s *FirewallService) DeletePaloAltoFirewall(p *DeletePaloAltoFirewallParams return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -2299,6 +2436,11 @@ func (s *FirewallService) ConfigurePaloAltoFirewall(p *ConfigurePaloAltoFirewall return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r ConfigurePaloAltoFirewallResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err @@ -2319,6 +2461,11 @@ func (s *FirewallService) ConfigurePaloAltoFirewall(p *ConfigurePaloAltoFirewall return nil, err } + b, err = convertFirewallServiceResponse(b) + if err != nil { + return nil, err + } + if err := json.Unmarshal(b, &r); err != nil { return nil, err } @@ -2430,6 +2577,11 @@ func (s *FirewallService) ListPaloAltoFirewalls(p *ListPaloAltoFirewallsParams) return nil, err } + resp, err = convertFirewallServiceResponse(resp) + if err != nil { + return nil, err + } + var r ListPaloAltoFirewallsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/HostService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/HostService.go index 427f278f5..ebe619f70 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/HostService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/HostService.go @@ -176,22 +176,23 @@ func (s *HostService) AddHost(p *AddHostParams) (*AddHostResponse, error) { } type AddHostResponse struct { - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -302,23 +303,24 @@ func (s *HostService) ReconnectHost(p *ReconnectHostParams) (*ReconnectHostRespo } type ReconnectHostResponse struct { - JobID string `json:"jobid,omitempty"` - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + JobID string `json:"jobid,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -454,22 +456,23 @@ func (s *HostService) UpdateHost(p *UpdateHostParams) (*UpdateHostResponse, erro } type UpdateHostResponse struct { - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -655,23 +658,24 @@ func (s *HostService) PrepareHostForMaintenance(p *PrepareHostForMaintenancePara } type PrepareHostForMaintenanceResponse struct { - JobID string `json:"jobid,omitempty"` - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + JobID string `json:"jobid,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -782,23 +786,24 @@ func (s *HostService) CancelHostMaintenance(p *CancelHostMaintenanceParams) (*Ca } type CancelHostMaintenanceResponse struct { - JobID string `json:"jobid,omitempty"` - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + JobID string `json:"jobid,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -1122,22 +1127,23 @@ type ListHostsResponse struct { } type Host struct { - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -1181,6 +1187,116 @@ type Host struct { Zonename string `json:"zonename,omitempty"` } +type ListHostTagsParams struct { + p map[string]interface{} +} + +func (p *ListHostTagsParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["keyword"]; found { + u.Set("keyword", v.(string)) + } + if v, found := p.p["page"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("page", vv) + } + if v, found := p.p["pagesize"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("pagesize", vv) + } + return u +} + +func (p *ListHostTagsParams) SetKeyword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["keyword"] = v + return +} + +func (p *ListHostTagsParams) SetPage(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["page"] = v + return +} + +func (p *ListHostTagsParams) SetPagesize(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["pagesize"] = v + return +} + +// You should always use this function to get a new ListHostTagsParams instance, +// as then you are sure you have configured all required params +func (s *HostService) NewListHostTagsParams() *ListHostTagsParams { + p := &ListHostTagsParams{} + p.p = make(map[string]interface{}) + return p +} + +// This is a courtesy helper function, which in some cases may not work as expected! +func (s *HostService) GetHostTagID(keyword string) (string, error) { + p := &ListHostTagsParams{} + p.p = make(map[string]interface{}) + + p.p["keyword"] = keyword + + l, err := s.ListHostTags(p) + if err != nil { + return "", err + } + + if l.Count == 0 { + return "", fmt.Errorf("No match found for %s: %+v", keyword, l) + } + + if l.Count == 1 { + return l.HostTags[0].Id, nil + } + + if l.Count > 1 { + for _, v := range l.HostTags { + if v.Name == keyword { + return v.Id, nil + } + } + } + return "", fmt.Errorf("Could not find an exact match for %s: %+v", keyword, l) +} + +// Lists host tags +func (s *HostService) ListHostTags(p *ListHostTagsParams) (*ListHostTagsResponse, error) { + resp, err := s.cs.newRequest("listHostTags", p.toURLValues()) + if err != nil { + return nil, err + } + + var r ListHostTagsResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type ListHostTagsResponse struct { + Count int `json:"count"` + HostTags []*HostTag `json:"hosttag"` +} + +type HostTag struct { + Hostid int64 `json:"hostid,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} + type FindHostsForMigrationParams struct { p map[string]interface{} } @@ -1396,6 +1512,10 @@ func (p *UpdateHostPasswordParams) toURLValues() url.Values { if v, found := p.p["password"]; found { u.Set("password", v.(string)) } + if v, found := p.p["update_passwd_on_host"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("update_passwd_on_host", vv) + } if v, found := p.p["username"]; found { u.Set("username", v.(string)) } @@ -1426,6 +1546,14 @@ func (p *UpdateHostPasswordParams) SetPassword(v string) { return } +func (p *UpdateHostPasswordParams) SetUpdate_passwd_on_host(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["update_passwd_on_host"] = v + return +} + func (p *UpdateHostPasswordParams) SetUsername(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1693,22 +1821,23 @@ func (s *HostService) AddBaremetalHost(p *AddBaremetalHostParams) (*AddBaremetal } type AddBaremetalHostResponse struct { - Averageload int64 `json:"averageload,omitempty"` - Capabilities string `json:"capabilities,omitempty"` - Clusterid string `json:"clusterid,omitempty"` - Clustername string `json:"clustername,omitempty"` - Clustertype string `json:"clustertype,omitempty"` - Cpuallocated string `json:"cpuallocated,omitempty"` - Cpunumber int `json:"cpunumber,omitempty"` - Cpusockets int `json:"cpusockets,omitempty"` - Cpuspeed int64 `json:"cpuspeed,omitempty"` - Cpuused string `json:"cpuused,omitempty"` - Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` - Created string `json:"created,omitempty"` - Disconnected string `json:"disconnected,omitempty"` - Disksizeallocated int64 `json:"disksizeallocated,omitempty"` - Disksizetotal int64 `json:"disksizetotal,omitempty"` - Events string `json:"events,omitempty"` + Averageload int64 `json:"averageload,omitempty"` + Capabilities string `json:"capabilities,omitempty"` + Clusterid string `json:"clusterid,omitempty"` + Clustername string `json:"clustername,omitempty"` + Clustertype string `json:"clustertype,omitempty"` + Cpuallocated string `json:"cpuallocated,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpusockets int `json:"cpusockets,omitempty"` + Cpuspeed int64 `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Cpuwithoverprovisioning string `json:"cpuwithoverprovisioning,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Disconnected string `json:"disconnected,omitempty"` + Disksizeallocated int64 `json:"disksizeallocated,omitempty"` + Disksizetotal int64 `json:"disksizetotal,omitempty"` + Events string `json:"events,omitempty"` Gpugroup []struct { Gpugroupname string `json:"gpugroupname,omitempty"` Vgpu []struct { @@ -2044,3 +2173,106 @@ type DedicatedHost struct { Hostname string `json:"hostname,omitempty"` Id string `json:"id,omitempty"` } + +type AddGloboDnsHostParams struct { + p map[string]interface{} +} + +func (p *AddGloboDnsHostParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["password"]; found { + u.Set("password", v.(string)) + } + if v, found := p.p["physicalnetworkid"]; found { + u.Set("physicalnetworkid", v.(string)) + } + if v, found := p.p["url"]; found { + u.Set("url", v.(string)) + } + if v, found := p.p["username"]; found { + u.Set("username", v.(string)) + } + return u +} + +func (p *AddGloboDnsHostParams) SetPassword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["password"] = v + return +} + +func (p *AddGloboDnsHostParams) SetPhysicalnetworkid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["physicalnetworkid"] = v + return +} + +func (p *AddGloboDnsHostParams) SetUrl(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["url"] = v + return +} + +func (p *AddGloboDnsHostParams) SetUsername(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["username"] = v + return +} + +// You should always use this function to get a new AddGloboDnsHostParams instance, +// as then you are sure you have configured all required params +func (s *HostService) NewAddGloboDnsHostParams(password string, physicalnetworkid string, url string, username string) *AddGloboDnsHostParams { + p := &AddGloboDnsHostParams{} + p.p = make(map[string]interface{}) + p.p["password"] = password + p.p["physicalnetworkid"] = physicalnetworkid + p.p["url"] = url + p.p["username"] = username + return p +} + +// Adds the GloboDNS external host +func (s *HostService) AddGloboDnsHost(p *AddGloboDnsHostParams) (*AddGloboDnsHostResponse, error) { + resp, err := s.cs.newRequest("addGloboDnsHost", p.toURLValues()) + if err != nil { + return nil, err + } + + var r AddGloboDnsHostResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type AddGloboDnsHostResponse struct { + JobID string `json:"jobid,omitempty"` + Displaytext string `json:"displaytext,omitempty"` + Success bool `json:"success,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ISOService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ISOService.go index 62348a7f0..f8efcaedd 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ISOService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ISOService.go @@ -112,6 +112,8 @@ type AttachIsoResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -248,6 +250,8 @@ type AttachIsoResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -268,6 +272,8 @@ type AttachIsoResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -349,6 +355,8 @@ type DetachIsoResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -485,6 +493,8 @@ type DetachIsoResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -505,6 +515,8 @@ type DetachIsoResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -1214,6 +1226,10 @@ func (p *UpdateIsoParams) toURLValues() url.Values { vv := strconv.FormatBool(v.(bool)) u.Set("passwordenabled", vv) } + if v, found := p.p["requireshvm"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("requireshvm", vv) + } if v, found := p.p["sortkey"]; found { vv := strconv.Itoa(v.(int)) u.Set("sortkey", vv) @@ -1301,6 +1317,14 @@ func (p *UpdateIsoParams) SetPasswordenabled(v bool) { return } +func (p *UpdateIsoParams) SetRequireshvm(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["requireshvm"] = v + return +} + func (p *UpdateIsoParams) SetSortkey(v int) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1515,7 +1539,7 @@ func (s *ISOService) NewCopyIsoParams(destzoneid string, id string) *CopyIsoPara return p } -// Copies an iso from one zone to another. +// Copies an ISO from one zone to another. func (s *ISOService) CopyIso(p *CopyIsoParams) (*CopyIsoResponse, error) { resp, err := s.cs.newRequest("copyIso", p.toURLValues()) if err != nil { @@ -1703,7 +1727,7 @@ func (s *ISOService) NewUpdateIsoPermissionsParams(id string) *UpdateIsoPermissi return p } -// Updates iso permissions +// Updates ISO permissions func (s *ISOService) UpdateIsoPermissions(p *UpdateIsoPermissionsParams) (*UpdateIsoPermissionsResponse, error) { resp, err := s.cs.newRequest("updateIsoPermissions", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ImageStoreService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ImageStoreService.go index 83194d820..accae7deb 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ImageStoreService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ImageStoreService.go @@ -131,6 +131,183 @@ type AddImageStoreResponse struct { Zonename string `json:"zonename,omitempty"` } +type AddImageStoreS3Params struct { + p map[string]interface{} +} + +func (p *AddImageStoreS3Params) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["accesskey"]; found { + u.Set("accesskey", v.(string)) + } + if v, found := p.p["bucket"]; found { + u.Set("bucket", v.(string)) + } + if v, found := p.p["connectiontimeout"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("connectiontimeout", vv) + } + if v, found := p.p["connectionttl"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("connectionttl", vv) + } + if v, found := p.p["endpoint"]; found { + u.Set("endpoint", v.(string)) + } + if v, found := p.p["maxerrorretry"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("maxerrorretry", vv) + } + if v, found := p.p["s3signer"]; found { + u.Set("s3signer", v.(string)) + } + if v, found := p.p["secretkey"]; found { + u.Set("secretkey", v.(string)) + } + if v, found := p.p["sockettimeout"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("sockettimeout", vv) + } + if v, found := p.p["usehttps"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("usehttps", vv) + } + if v, found := p.p["usetcpkeepalive"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("usetcpkeepalive", vv) + } + return u +} + +func (p *AddImageStoreS3Params) SetAccesskey(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["accesskey"] = v + return +} + +func (p *AddImageStoreS3Params) SetBucket(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["bucket"] = v + return +} + +func (p *AddImageStoreS3Params) SetConnectiontimeout(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["connectiontimeout"] = v + return +} + +func (p *AddImageStoreS3Params) SetConnectionttl(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["connectionttl"] = v + return +} + +func (p *AddImageStoreS3Params) SetEndpoint(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["endpoint"] = v + return +} + +func (p *AddImageStoreS3Params) SetMaxerrorretry(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["maxerrorretry"] = v + return +} + +func (p *AddImageStoreS3Params) SetS3signer(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["s3signer"] = v + return +} + +func (p *AddImageStoreS3Params) SetSecretkey(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["secretkey"] = v + return +} + +func (p *AddImageStoreS3Params) SetSockettimeout(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["sockettimeout"] = v + return +} + +func (p *AddImageStoreS3Params) SetUsehttps(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["usehttps"] = v + return +} + +func (p *AddImageStoreS3Params) SetUsetcpkeepalive(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["usetcpkeepalive"] = v + return +} + +// You should always use this function to get a new AddImageStoreS3Params instance, +// as then you are sure you have configured all required params +func (s *ImageStoreService) NewAddImageStoreS3Params(accesskey string, bucket string, endpoint string, secretkey string) *AddImageStoreS3Params { + p := &AddImageStoreS3Params{} + p.p = make(map[string]interface{}) + p.p["accesskey"] = accesskey + p.p["bucket"] = bucket + p.p["endpoint"] = endpoint + p.p["secretkey"] = secretkey + return p +} + +// Adds S3 Image Store +func (s *ImageStoreService) AddImageStoreS3(p *AddImageStoreS3Params) (*AddImageStoreS3Response, error) { + resp, err := s.cs.newRequest("addImageStoreS3", p.toURLValues()) + if err != nil { + return nil, err + } + + var r AddImageStoreS3Response + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type AddImageStoreS3Response struct { + Details []string `json:"details,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Protocol string `json:"protocol,omitempty"` + Providername string `json:"providername,omitempty"` + Scope string `json:"scope,omitempty"` + Url string `json:"url,omitempty"` + Zoneid string `json:"zoneid,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + type ListImageStoresParams struct { p map[string]interface{} } @@ -375,7 +552,7 @@ func (s *ImageStoreService) NewDeleteImageStoreParams(id string) *DeleteImageSto return p } -// Deletes an image store . +// Deletes an image store or Secondary Storage. func (s *ImageStoreService) DeleteImageStore(p *DeleteImageStoreParams) (*DeleteImageStoreResponse, error) { resp, err := s.cs.newRequest("deleteImageStore", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/InternalLBService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/InternalLBService.go index b4fceda57..71eab8f57 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/InternalLBService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/InternalLBService.go @@ -415,8 +415,10 @@ type StopInternalLoadBalancerVMResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -467,6 +469,7 @@ type StopInternalLoadBalancerVMResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -550,8 +553,10 @@ type StartInternalLoadBalancerVMResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -602,6 +607,7 @@ type StartInternalLoadBalancerVMResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -945,8 +951,10 @@ type InternalLoadBalancerVM struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -997,6 +1005,7 @@ type InternalLoadBalancerVM struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go index 03d1ec4ec..0d2bfd470 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go @@ -628,7 +628,7 @@ func (s *LoadBalancerService) NewCreateLBStickinessPolicyParams(lbruleid string, return p } -// Creates a Load Balancer stickiness policy +// Creates a load balancer stickiness policy func (s *LoadBalancerService) CreateLBStickinessPolicy(p *CreateLBStickinessPolicyParams) (*CreateLBStickinessPolicyResponse, error) { resp, err := s.cs.newRequest("createLBStickinessPolicy", p.toURLValues()) if err != nil { @@ -738,7 +738,7 @@ func (s *LoadBalancerService) NewUpdateLBStickinessPolicyParams(id string) *Upda return p } -// Updates LB Stickiness policy +// Updates load balancer stickiness policy func (s *LoadBalancerService) UpdateLBStickinessPolicy(p *UpdateLBStickinessPolicyParams) (*UpdateLBStickinessPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBStickinessPolicy", p.toURLValues()) if err != nil { @@ -825,7 +825,7 @@ func (s *LoadBalancerService) NewDeleteLBStickinessPolicyParams(id string) *Dele return p } -// Deletes a LB stickiness policy. +// Deletes a load balancer stickiness policy. func (s *LoadBalancerService) DeleteLBStickinessPolicy(p *DeleteLBStickinessPolicyParams) (*DeleteLBStickinessPolicyResponse, error) { resp, err := s.cs.newRequest("deleteLBStickinessPolicy", p.toURLValues()) if err != nil { @@ -1331,7 +1331,7 @@ func (s *LoadBalancerService) GetLBStickinessPolicyByID(id string) (*LBStickines return nil, l.Count, fmt.Errorf("There is more then one result for LBStickinessPolicy UUID: %s!", id) } -// Lists LBStickiness policies. +// Lists load balancer stickiness policies. func (s *LoadBalancerService) ListLBStickinessPolicies(p *ListLBStickinessPoliciesParams) (*ListLBStickinessPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBStickinessPolicies", p.toURLValues()) if err != nil { @@ -1486,7 +1486,7 @@ func (s *LoadBalancerService) GetLBHealthCheckPolicyByID(id string) (*LBHealthCh return nil, l.Count, fmt.Errorf("There is more then one result for LBHealthCheckPolicy UUID: %s!", id) } -// Lists load balancer HealthCheck policies. +// Lists load balancer health check policies. func (s *LoadBalancerService) ListLBHealthCheckPolicies(p *ListLBHealthCheckPoliciesParams) (*ListLBHealthCheckPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBHealthCheckPolicies", p.toURLValues()) if err != nil { @@ -1638,7 +1638,7 @@ func (s *LoadBalancerService) NewCreateLBHealthCheckPolicyParams(lbruleid string return p } -// Creates a Load Balancer healthcheck policy +// Creates a load balancer health check policy func (s *LoadBalancerService) CreateLBHealthCheckPolicy(p *CreateLBHealthCheckPolicyParams) (*CreateLBHealthCheckPolicyResponse, error) { resp, err := s.cs.newRequest("createLBHealthCheckPolicy", p.toURLValues()) if err != nil { @@ -1747,7 +1747,7 @@ func (s *LoadBalancerService) NewUpdateLBHealthCheckPolicyParams(id string) *Upd return p } -// Updates LB HealthCheck policy +// Updates load balancer health check policy func (s *LoadBalancerService) UpdateLBHealthCheckPolicy(p *UpdateLBHealthCheckPolicyParams) (*UpdateLBHealthCheckPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBHealthCheckPolicy", p.toURLValues()) if err != nil { @@ -1833,7 +1833,7 @@ func (s *LoadBalancerService) NewDeleteLBHealthCheckPolicyParams(id string) *Del return p } -// Deletes a load balancer HealthCheck policy. +// Deletes a load balancer health check policy. func (s *LoadBalancerService) DeleteLBHealthCheckPolicy(p *DeleteLBHealthCheckPolicyParams) (*DeleteLBHealthCheckPolicyResponse, error) { resp, err := s.cs.newRequest("deleteLBHealthCheckPolicy", p.toURLValues()) if err != nil { @@ -2267,7 +2267,7 @@ func (s *LoadBalancerService) NewUploadSslCertParams(certificate string, private return p } -// Upload a certificate to cloudstack +// Upload a certificate to CloudStack func (s *LoadBalancerService) UploadSslCert(p *UploadSslCertParams) (*UploadSslCertResponse, error) { resp, err := s.cs.newRequest("uploadSslCert", p.toURLValues()) if err != nil { @@ -2326,7 +2326,7 @@ func (s *LoadBalancerService) NewDeleteSslCertParams(id string) *DeleteSslCertPa return p } -// Delete a certificate to cloudstack +// Delete a certificate to CloudStack func (s *LoadBalancerService) DeleteSslCert(p *DeleteSslCertParams) (*DeleteSslCertResponse, error) { resp, err := s.cs.newRequest("deleteSslCert", p.toURLValues()) if err != nil { @@ -2485,7 +2485,7 @@ func (s *LoadBalancerService) NewAssignCertToLoadBalancerParams(certid string, l return p } -// Assigns a certificate to a Load Balancer Rule +// Assigns a certificate to a load balancer rule func (s *LoadBalancerService) AssignCertToLoadBalancer(p *AssignCertToLoadBalancerParams) (*AssignCertToLoadBalancerResponse, error) { resp, err := s.cs.newRequest("assignCertToLoadBalancer", p.toURLValues()) if err != nil { @@ -2552,7 +2552,7 @@ func (s *LoadBalancerService) NewRemoveCertFromLoadBalancerParams(lbruleid strin return p } -// Removes a certificate from a Load Balancer Rule +// Removes a certificate from a load balancer rule func (s *LoadBalancerService) RemoveCertFromLoadBalancer(p *RemoveCertFromLoadBalancerParams) (*RemoveCertFromLoadBalancerResponse, error) { resp, err := s.cs.newRequest("removeCertFromLoadBalancer", p.toURLValues()) if err != nil { @@ -4135,7 +4135,7 @@ func (s *LoadBalancerService) NewCreateLoadBalancerParams(algorithm string, inst return p } -// Creates a Load Balancer +// Creates a load balancer func (s *LoadBalancerService) CreateLoadBalancer(p *CreateLoadBalancerParams) (*CreateLoadBalancerResponse, error) { resp, err := s.cs.newRequest("createLoadBalancer", p.toURLValues()) if err != nil { @@ -4511,7 +4511,7 @@ func (s *LoadBalancerService) GetLoadBalancerByID(id string) (*LoadBalancer, int return nil, l.Count, fmt.Errorf("There is more then one result for LoadBalancer UUID: %s!", id) } -// Lists Load Balancers +// Lists load balancers func (s *LoadBalancerService) ListLoadBalancers(p *ListLoadBalancersParams) (*ListLoadBalancersResponse, error) { resp, err := s.cs.newRequest("listLoadBalancers", p.toURLValues()) if err != nil { @@ -4691,7 +4691,7 @@ func (s *LoadBalancerService) NewUpdateLoadBalancerParams(id string) *UpdateLoad return p } -// Updates a Load Balancer +// Updates a load balancer func (s *LoadBalancerService) UpdateLoadBalancer(p *UpdateLoadBalancerParams) (*UpdateLoadBalancerResponse, error) { resp, err := s.cs.newRequest("updateLoadBalancer", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoginService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoginService.go deleted file mode 100644 index bd6db4a97..000000000 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoginService.go +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright 2014, Sander van Harmelen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package cloudstack diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LogoutService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LogoutService.go deleted file mode 100644 index bd6db4a97..000000000 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LogoutService.go +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright 2014, Sander van Harmelen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package cloudstack diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NATService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NATService.go index 25ad9a162..be3b4df0a 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NATService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NATService.go @@ -90,7 +90,7 @@ func (s *NATService) NewEnableStaticNatParams(ipaddressid string, virtualmachine return p } -// Enables static nat for given ip address +// Enables static NAT for given IP address func (s *NATService) EnableStaticNat(p *EnableStaticNatParams) (*EnableStaticNatResponse, error) { resp, err := s.cs.newRequest("enableStaticNat", p.toURLValues()) if err != nil { @@ -202,7 +202,7 @@ func (s *NATService) NewCreateIpForwardingRuleParams(ipaddressid string, protoco return p } -// Creates an ip forwarding rule +// Creates an IP forwarding rule func (s *NATService) CreateIpForwardingRule(p *CreateIpForwardingRuleParams) (*CreateIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("createIpForwardingRule", p.toURLValues()) if err != nil { @@ -300,7 +300,7 @@ func (s *NATService) NewDeleteIpForwardingRuleParams(id string) *DeleteIpForward return p } -// Deletes an ip forwarding rule +// Deletes an IP forwarding rule func (s *NATService) DeleteIpForwardingRule(p *DeleteIpForwardingRuleParams) (*DeleteIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("deleteIpForwardingRule", p.toURLValues()) if err != nil { @@ -522,7 +522,7 @@ func (s *NATService) GetIpForwardingRuleByID(id string) (*IpForwardingRule, int, return nil, l.Count, fmt.Errorf("There is more then one result for IpForwardingRule UUID: %s!", id) } -// List the ip forwarding rules +// List the IP forwarding rules func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) { resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues()) if err != nil { @@ -604,7 +604,7 @@ func (s *NATService) NewDisableStaticNatParams(ipaddressid string) *DisableStati return p } -// Disables static rule for given ip address +// Disables static rule for given IP address func (s *NATService) DisableStaticNat(p *DisableStaticNatParams) (*DisableStaticNatResponse, error) { resp, err := s.cs.newRequest("disableStaticNat", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkACLService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkACLService.go index cc748f061..b0ecfe1e0 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkACLService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkACLService.go @@ -407,7 +407,7 @@ func (s *NetworkACLService) NewUpdateNetworkACLItemParams(id string) *UpdateNetw return p } -// Updates ACL Item with specified Id +// Updates ACL item with specified ID func (s *NetworkACLService) UpdateNetworkACLItem(p *UpdateNetworkACLItemParams) (*UpdateNetworkACLItemResponse, error) { resp, err := s.cs.newRequest("updateNetworkACLItem", p.toURLValues()) if err != nil { @@ -502,7 +502,7 @@ func (s *NetworkACLService) NewDeleteNetworkACLParams(id string) *DeleteNetworkA return p } -// Deletes a Network ACL +// Deletes a network ACL func (s *NetworkACLService) DeleteNetworkACL(p *DeleteNetworkACLParams) (*DeleteNetworkACLResponse, error) { resp, err := s.cs.newRequest("deleteNetworkACL", p.toURLValues()) if err != nil { @@ -899,7 +899,7 @@ func (s *NetworkACLService) NewCreateNetworkACLListParams(name string, vpcid str return p } -// Creates a Network ACL for the given VPC +// Creates a network ACL for the given VPC func (s *NetworkACLService) CreateNetworkACLList(p *CreateNetworkACLListParams) (*CreateNetworkACLListResponse, error) { resp, err := s.cs.newRequest("createNetworkACLList", p.toURLValues()) if err != nil { @@ -974,7 +974,7 @@ func (s *NetworkACLService) NewDeleteNetworkACLListParams(id string) *DeleteNetw return p } -// Deletes a Network ACL +// Deletes a network ACL func (s *NetworkACLService) DeleteNetworkACLList(p *DeleteNetworkACLListParams) (*DeleteNetworkACLListResponse, error) { resp, err := s.cs.newRequest("deleteNetworkACLList", p.toURLValues()) if err != nil { @@ -1063,7 +1063,7 @@ func (s *NetworkACLService) NewReplaceNetworkACLListParams(aclid string) *Replac return p } -// Replaces ACL associated with a Network or private gateway +// Replaces ACL associated with a network or private gateway func (s *NetworkACLService) ReplaceNetworkACLList(p *ReplaceNetworkACLListParams) (*ReplaceNetworkACLListResponse, error) { resp, err := s.cs.newRequest("replaceNetworkACLList", p.toURLValues()) if err != nil { @@ -1444,7 +1444,7 @@ func (s *NetworkACLService) NewUpdateNetworkACLListParams(id string) *UpdateNetw return p } -// Updates Network ACL list +// Updates network ACL list func (s *NetworkACLService) UpdateNetworkACLList(p *UpdateNetworkACLListParams) (*UpdateNetworkACLListResponse, error) { resp, err := s.cs.newRequest("updateNetworkACLList", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkService.go index 1e9bda43c..027bb9a97 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NetworkService.go @@ -82,10 +82,9 @@ func (p *DedicatePublicIpRangeParams) SetProjectid(v string) { // You should always use this function to get a new DedicatePublicIpRangeParams instance, // as then you are sure you have configured all required params -func (s *NetworkService) NewDedicatePublicIpRangeParams(account string, domainid string, id string) *DedicatePublicIpRangeParams { +func (s *NetworkService) NewDedicatePublicIpRangeParams(domainid string, id string) *DedicatePublicIpRangeParams { p := &DedicatePublicIpRangeParams{} p.p = make(map[string]interface{}) - p.p["account"] = account p.p["domainid"] = domainid p.p["id"] = id return p @@ -258,9 +257,6 @@ func (p *CreateNetworkParams) toURLValues() url.Values { if v, found := p.p["vlan"]; found { u.Set("vlan", v.(string)) } - if v, found := p.p["vlan"]; found { - u.Set("vlan", v.(string)) - } if v, found := p.p["vpcid"]; found { u.Set("vpcid", v.(string)) } @@ -1175,7 +1171,7 @@ func (s *NetworkService) NewRestartNetworkParams(id string) *RestartNetworkParam return p } -// Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules +// Restarts the network; includes 1) restarting network elements - virtual routers, DHCP servers 2) reapplying all public IPs 3) reapplying loadBalancing/portForwarding rules func (s *NetworkService) RestartNetwork(p *RestartNetworkParams) (*RestartNetworkResponse, error) { resp, err := s.cs.newRequest("restartNetwork", p.toURLValues()) if err != nil { @@ -3709,3 +3705,285 @@ type ListNetworkIsolationMethodsResponse struct { type NetworkIsolationMethod struct { Name string `json:"name,omitempty"` } + +type AddOpenDaylightControllerParams struct { + p map[string]interface{} +} + +func (p *AddOpenDaylightControllerParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["password"]; found { + u.Set("password", v.(string)) + } + if v, found := p.p["physicalnetworkid"]; found { + u.Set("physicalnetworkid", v.(string)) + } + if v, found := p.p["url"]; found { + u.Set("url", v.(string)) + } + if v, found := p.p["username"]; found { + u.Set("username", v.(string)) + } + return u +} + +func (p *AddOpenDaylightControllerParams) SetPassword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["password"] = v + return +} + +func (p *AddOpenDaylightControllerParams) SetPhysicalnetworkid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["physicalnetworkid"] = v + return +} + +func (p *AddOpenDaylightControllerParams) SetUrl(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["url"] = v + return +} + +func (p *AddOpenDaylightControllerParams) SetUsername(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["username"] = v + return +} + +// You should always use this function to get a new AddOpenDaylightControllerParams instance, +// as then you are sure you have configured all required params +func (s *NetworkService) NewAddOpenDaylightControllerParams(password string, physicalnetworkid string, url string, username string) *AddOpenDaylightControllerParams { + p := &AddOpenDaylightControllerParams{} + p.p = make(map[string]interface{}) + p.p["password"] = password + p.p["physicalnetworkid"] = physicalnetworkid + p.p["url"] = url + p.p["username"] = username + return p +} + +// Adds an OpenDyalight controler +func (s *NetworkService) AddOpenDaylightController(p *AddOpenDaylightControllerParams) (*AddOpenDaylightControllerResponse, error) { + resp, err := s.cs.newRequest("addOpenDaylightController", p.toURLValues()) + if err != nil { + return nil, err + } + + var r AddOpenDaylightControllerResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + b, err = getRawValue(b) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type AddOpenDaylightControllerResponse struct { + JobID string `json:"jobid,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Physicalnetworkid string `json:"physicalnetworkid,omitempty"` + Url string `json:"url,omitempty"` + Username string `json:"username,omitempty"` +} + +type DeleteOpenDaylightControllerParams struct { + p map[string]interface{} +} + +func (p *DeleteOpenDaylightControllerParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["id"]; found { + u.Set("id", v.(string)) + } + return u +} + +func (p *DeleteOpenDaylightControllerParams) SetId(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["id"] = v + return +} + +// You should always use this function to get a new DeleteOpenDaylightControllerParams instance, +// as then you are sure you have configured all required params +func (s *NetworkService) NewDeleteOpenDaylightControllerParams(id string) *DeleteOpenDaylightControllerParams { + p := &DeleteOpenDaylightControllerParams{} + p.p = make(map[string]interface{}) + p.p["id"] = id + return p +} + +// Removes an OpenDyalight controler +func (s *NetworkService) DeleteOpenDaylightController(p *DeleteOpenDaylightControllerParams) (*DeleteOpenDaylightControllerResponse, error) { + resp, err := s.cs.newRequest("deleteOpenDaylightController", p.toURLValues()) + if err != nil { + return nil, err + } + + var r DeleteOpenDaylightControllerResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + b, err = getRawValue(b) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type DeleteOpenDaylightControllerResponse struct { + JobID string `json:"jobid,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Physicalnetworkid string `json:"physicalnetworkid,omitempty"` + Url string `json:"url,omitempty"` + Username string `json:"username,omitempty"` +} + +type ListOpenDaylightControllersParams struct { + p map[string]interface{} +} + +func (p *ListOpenDaylightControllersParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["id"]; found { + u.Set("id", v.(string)) + } + if v, found := p.p["physicalnetworkid"]; found { + u.Set("physicalnetworkid", v.(string)) + } + return u +} + +func (p *ListOpenDaylightControllersParams) SetId(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["id"] = v + return +} + +func (p *ListOpenDaylightControllersParams) SetPhysicalnetworkid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["physicalnetworkid"] = v + return +} + +// You should always use this function to get a new ListOpenDaylightControllersParams instance, +// as then you are sure you have configured all required params +func (s *NetworkService) NewListOpenDaylightControllersParams() *ListOpenDaylightControllersParams { + p := &ListOpenDaylightControllersParams{} + p.p = make(map[string]interface{}) + return p +} + +// This is a courtesy helper function, which in some cases may not work as expected! +func (s *NetworkService) GetOpenDaylightControllerByID(id string) (*OpenDaylightController, int, error) { + p := &ListOpenDaylightControllersParams{} + p.p = make(map[string]interface{}) + + p.p["id"] = id + + l, err := s.ListOpenDaylightControllers(p) + if err != nil { + if strings.Contains(err.Error(), fmt.Sprintf( + "Invalid parameter id value=%s due to incorrect long value format, "+ + "or entity does not exist", id)) { + return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l) + } + return nil, -1, err + } + + if l.Count == 0 { + return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l) + } + + if l.Count == 1 { + return l.OpenDaylightControllers[0], l.Count, nil + } + return nil, l.Count, fmt.Errorf("There is more then one result for OpenDaylightController UUID: %s!", id) +} + +// Lists OpenDyalight controllers +func (s *NetworkService) ListOpenDaylightControllers(p *ListOpenDaylightControllersParams) (*ListOpenDaylightControllersResponse, error) { + resp, err := s.cs.newRequest("listOpenDaylightControllers", p.toURLValues()) + if err != nil { + return nil, err + } + + var r ListOpenDaylightControllersResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type ListOpenDaylightControllersResponse struct { + Count int `json:"count"` + OpenDaylightControllers []*OpenDaylightController `json:"opendaylightcontroller"` +} + +type OpenDaylightController struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Physicalnetworkid string `json:"physicalnetworkid,omitempty"` + Url string `json:"url,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NicService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NicService.go index 3ef49d6ad..b4575bd08 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/NicService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/NicService.go @@ -175,6 +175,260 @@ type RemoveIpFromNicResponse struct { Success bool `json:"success,omitempty"` } +type UpdateVmNicIpParams struct { + p map[string]interface{} +} + +func (p *UpdateVmNicIpParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["ipaddress"]; found { + u.Set("ipaddress", v.(string)) + } + if v, found := p.p["nicid"]; found { + u.Set("nicid", v.(string)) + } + return u +} + +func (p *UpdateVmNicIpParams) SetIpaddress(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ipaddress"] = v + return +} + +func (p *UpdateVmNicIpParams) SetNicid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["nicid"] = v + return +} + +// You should always use this function to get a new UpdateVmNicIpParams instance, +// as then you are sure you have configured all required params +func (s *NicService) NewUpdateVmNicIpParams(nicid string) *UpdateVmNicIpParams { + p := &UpdateVmNicIpParams{} + p.p = make(map[string]interface{}) + p.p["nicid"] = nicid + return p +} + +// Update the default Ip of a VM Nic +func (s *NicService) UpdateVmNicIp(p *UpdateVmNicIpParams) (*UpdateVmNicIpResponse, error) { + resp, err := s.cs.newRequest("updateVmNicIp", p.toURLValues()) + if err != nil { + return nil, err + } + + var r UpdateVmNicIpResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + + // If we have a async client, we need to wait for the async result + if s.cs.async { + b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) + if err != nil { + if err == AsyncTimeoutErr { + return &r, err + } + return nil, err + } + + b, err = getRawValue(b) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(b, &r); err != nil { + return nil, err + } + } + return &r, nil +} + +type UpdateVmNicIpResponse struct { + JobID string `json:"jobid,omitempty"` + Account string `json:"account,omitempty"` + Affinitygroup []struct { + Account string `json:"account,omitempty"` + Description string `json:"description,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Type string `json:"type,omitempty"` + VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` + } `json:"affinitygroup,omitempty"` + Cpunumber int `json:"cpunumber,omitempty"` + Cpuspeed int `json:"cpuspeed,omitempty"` + Cpuused string `json:"cpuused,omitempty"` + Created string `json:"created,omitempty"` + Details map[string]string `json:"details,omitempty"` + Diskioread int64 `json:"diskioread,omitempty"` + Diskiowrite int64 `json:"diskiowrite,omitempty"` + Diskkbsread int64 `json:"diskkbsread,omitempty"` + Diskkbswrite int64 `json:"diskkbswrite,omitempty"` + Diskofferingid string `json:"diskofferingid,omitempty"` + Diskofferingname string `json:"diskofferingname,omitempty"` + Displayname string `json:"displayname,omitempty"` + Displayvm bool `json:"displayvm,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Forvirtualnetwork bool `json:"forvirtualnetwork,omitempty"` + Group string `json:"group,omitempty"` + Groupid string `json:"groupid,omitempty"` + Guestosid string `json:"guestosid,omitempty"` + Haenable bool `json:"haenable,omitempty"` + Hostid string `json:"hostid,omitempty"` + Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` + Id string `json:"id,omitempty"` + Instancename string `json:"instancename,omitempty"` + Isdynamicallyscalable bool `json:"isdynamicallyscalable,omitempty"` + Isodisplaytext string `json:"isodisplaytext,omitempty"` + Isoid string `json:"isoid,omitempty"` + Isoname string `json:"isoname,omitempty"` + Keypair string `json:"keypair,omitempty"` + Memory int `json:"memory,omitempty"` + Name string `json:"name,omitempty"` + Networkkbsread int64 `json:"networkkbsread,omitempty"` + Networkkbswrite int64 `json:"networkkbswrite,omitempty"` + Nic []struct { + Broadcasturi string `json:"broadcasturi,omitempty"` + Deviceid string `json:"deviceid,omitempty"` + Gateway string `json:"gateway,omitempty"` + Id string `json:"id,omitempty"` + Ip6address string `json:"ip6address,omitempty"` + Ip6cidr string `json:"ip6cidr,omitempty"` + Ip6gateway string `json:"ip6gateway,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Isolationuri string `json:"isolationuri,omitempty"` + Macaddress string `json:"macaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Networkid string `json:"networkid,omitempty"` + Networkname string `json:"networkname,omitempty"` + Secondaryip []struct { + Id string `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + } `json:"secondaryip,omitempty"` + Traffictype string `json:"traffictype,omitempty"` + Type string `json:"type,omitempty"` + Virtualmachineid string `json:"virtualmachineid,omitempty"` + } `json:"nic,omitempty"` + Ostypeid int64 `json:"ostypeid,omitempty"` + Password string `json:"password,omitempty"` + Passwordenabled bool `json:"passwordenabled,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicipid string `json:"publicipid,omitempty"` + Rootdeviceid int64 `json:"rootdeviceid,omitempty"` + Rootdevicetype string `json:"rootdevicetype,omitempty"` + Securitygroup []struct { + Account string `json:"account,omitempty"` + Description string `json:"description,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Egressrule []struct { + Account string `json:"account,omitempty"` + Cidr string `json:"cidr,omitempty"` + Endport int `json:"endport,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + Protocol string `json:"protocol,omitempty"` + Ruleid string `json:"ruleid,omitempty"` + Securitygroupname string `json:"securitygroupname,omitempty"` + Startport int `json:"startport,omitempty"` + Tags []struct { + Account string `json:"account,omitempty"` + Customer string `json:"customer,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Key string `json:"key,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Resourcetype string `json:"resourcetype,omitempty"` + Value string `json:"value,omitempty"` + } `json:"tags,omitempty"` + } `json:"egressrule,omitempty"` + Id string `json:"id,omitempty"` + Ingressrule []struct { + Account string `json:"account,omitempty"` + Cidr string `json:"cidr,omitempty"` + Endport int `json:"endport,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + Protocol string `json:"protocol,omitempty"` + Ruleid string `json:"ruleid,omitempty"` + Securitygroupname string `json:"securitygroupname,omitempty"` + Startport int `json:"startport,omitempty"` + Tags []struct { + Account string `json:"account,omitempty"` + Customer string `json:"customer,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Key string `json:"key,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Resourcetype string `json:"resourcetype,omitempty"` + Value string `json:"value,omitempty"` + } `json:"tags,omitempty"` + } `json:"ingressrule,omitempty"` + Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Tags []struct { + Account string `json:"account,omitempty"` + Customer string `json:"customer,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Key string `json:"key,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Resourcetype string `json:"resourcetype,omitempty"` + Value string `json:"value,omitempty"` + } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` + } `json:"securitygroup,omitempty"` + Serviceofferingid string `json:"serviceofferingid,omitempty"` + Serviceofferingname string `json:"serviceofferingname,omitempty"` + Servicestate string `json:"servicestate,omitempty"` + State string `json:"state,omitempty"` + Tags []struct { + Account string `json:"account,omitempty"` + Customer string `json:"customer,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` + Key string `json:"key,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Resourcetype string `json:"resourcetype,omitempty"` + Value string `json:"value,omitempty"` + } `json:"tags,omitempty"` + Templatedisplaytext string `json:"templatedisplaytext,omitempty"` + Templateid string `json:"templateid,omitempty"` + Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` + Vgpu string `json:"vgpu,omitempty"` + Zoneid string `json:"zoneid,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + type ListNicsParams struct { p map[string]interface{} } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go index c42224ec8..c8753a336 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go @@ -514,6 +514,10 @@ func (p *UpdateStoragePoolParams) toURLValues() url.Values { vv := strconv.FormatInt(v.(int64), 10) u.Set("capacityiops", vv) } + if v, found := p.p["enabled"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("enabled", vv) + } if v, found := p.p["id"]; found { u.Set("id", v.(string)) } @@ -540,6 +544,14 @@ func (p *UpdateStoragePoolParams) SetCapacityiops(v int64) { return } +func (p *UpdateStoragePoolParams) SetEnabled(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["enabled"] = v + return +} + func (p *UpdateStoragePoolParams) SetId(v string) { if p.p == nil { p.p = make(map[string]interface{}) diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ProjectService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ProjectService.go index b826868a9..d37b502ea 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ProjectService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ProjectService.go @@ -1139,7 +1139,7 @@ func (s *ProjectService) GetProjectInvitationByID(id string) (*ProjectInvitation return nil, l.Count, fmt.Errorf("There is more then one result for ProjectInvitation UUID: %s!", id) } -// Lists projects and provides detailed information for listed projects +// Lists project invitations and provides detailed information for listed invitations func (s *ProjectService) ListProjectInvitations(p *ListProjectInvitationsParams) (*ListProjectInvitationsResponse, error) { resp, err := s.cs.newRequest("listProjectInvitations", p.toURLValues()) if err != nil { @@ -1302,7 +1302,7 @@ func (s *ProjectService) NewDeleteProjectInvitationParams(id string) *DeleteProj return p } -// Accepts or declines project invitation +// Deletes project invitation func (s *ProjectService) DeleteProjectInvitation(p *DeleteProjectInvitationParams) (*DeleteProjectInvitationResponse, error) { resp, err := s.cs.newRequest("deleteProjectInvitation", p.toURLValues()) if err != nil { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/QuotaService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/QuotaService.go new file mode 100644 index 000000000..867f740cc --- /dev/null +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/QuotaService.go @@ -0,0 +1,60 @@ +// +// Copyright 2014, Sander van Harmelen +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package cloudstack + +import ( + "encoding/json" + "net/url" +) + +type QuotaIsEnabledParams struct { + p map[string]interface{} +} + +func (p *QuotaIsEnabledParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + return u +} + +// You should always use this function to get a new QuotaIsEnabledParams instance, +// as then you are sure you have configured all required params +func (s *QuotaService) NewQuotaIsEnabledParams() *QuotaIsEnabledParams { + p := &QuotaIsEnabledParams{} + p.p = make(map[string]interface{}) + return p +} + +// Return true if the plugin is enabled +func (s *QuotaService) QuotaIsEnabled(p *QuotaIsEnabledParams) (*QuotaIsEnabledResponse, error) { + resp, err := s.cs.newRequest("quotaIsEnabled", p.toURLValues()) + if err != nil { + return nil, err + } + + var r QuotaIsEnabledResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type QuotaIsEnabledResponse struct { + Isenabled bool `json:"isenabled,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ResourcetagsService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ResourcetagsService.go index abfd86245..a3b18bfa5 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ResourcetagsService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ResourcetagsService.go @@ -24,6 +24,116 @@ import ( "strings" ) +type ListStorageTagsParams struct { + p map[string]interface{} +} + +func (p *ListStorageTagsParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["keyword"]; found { + u.Set("keyword", v.(string)) + } + if v, found := p.p["page"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("page", vv) + } + if v, found := p.p["pagesize"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("pagesize", vv) + } + return u +} + +func (p *ListStorageTagsParams) SetKeyword(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["keyword"] = v + return +} + +func (p *ListStorageTagsParams) SetPage(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["page"] = v + return +} + +func (p *ListStorageTagsParams) SetPagesize(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["pagesize"] = v + return +} + +// You should always use this function to get a new ListStorageTagsParams instance, +// as then you are sure you have configured all required params +func (s *ResourcetagsService) NewListStorageTagsParams() *ListStorageTagsParams { + p := &ListStorageTagsParams{} + p.p = make(map[string]interface{}) + return p +} + +// This is a courtesy helper function, which in some cases may not work as expected! +func (s *ResourcetagsService) GetStorageTagID(keyword string) (string, error) { + p := &ListStorageTagsParams{} + p.p = make(map[string]interface{}) + + p.p["keyword"] = keyword + + l, err := s.ListStorageTags(p) + if err != nil { + return "", err + } + + if l.Count == 0 { + return "", fmt.Errorf("No match found for %s: %+v", keyword, l) + } + + if l.Count == 1 { + return l.StorageTags[0].Id, nil + } + + if l.Count > 1 { + for _, v := range l.StorageTags { + if v.Name == keyword { + return v.Id, nil + } + } + } + return "", fmt.Errorf("Could not find an exact match for %s: %+v", keyword, l) +} + +// Lists storage tags +func (s *ResourcetagsService) ListStorageTags(p *ListStorageTagsParams) (*ListStorageTagsResponse, error) { + resp, err := s.cs.newRequest("listStorageTags", p.toURLValues()) + if err != nil { + return nil, err + } + + var r ListStorageTagsResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type ListStorageTagsResponse struct { + Count int `json:"count"` + StorageTags []*StorageTag `json:"storagetag"` +} + +type StorageTag struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Poolid int64 `json:"poolid,omitempty"` +} + type CreateTagsParams struct { p map[string]interface{} } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/RouterService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/RouterService.go index 6bd59e496..6e3a532a9 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/RouterService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/RouterService.go @@ -103,8 +103,10 @@ type StartRouterResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -155,6 +157,7 @@ type StartRouterResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -238,8 +241,10 @@ type RebootRouterResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -290,6 +295,7 @@ type RebootRouterResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -385,8 +391,10 @@ type StopRouterResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -437,6 +445,7 @@ type StopRouterResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -520,8 +529,10 @@ type DestroyRouterResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -572,6 +583,7 @@ type DestroyRouterResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -646,8 +658,10 @@ type ChangeServiceForRouterResponse struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -698,6 +712,7 @@ type ChangeServiceForRouterResponse struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } @@ -1063,8 +1078,10 @@ type Router struct { Guestmacaddress string `json:"guestmacaddress,omitempty"` Guestnetmask string `json:"guestnetmask,omitempty"` Guestnetworkid string `json:"guestnetworkid,omitempty"` + Guestnetworkname string `json:"guestnetworkname,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Ip6dns1 string `json:"ip6dns1,omitempty"` Ip6dns2 string `json:"ip6dns2,omitempty"` @@ -1115,6 +1132,7 @@ type Router struct { Templateid string `json:"templateid,omitempty"` Version string `json:"version,omitempty"` Vpcid string `json:"vpcid,omitempty"` + Vpcname string `json:"vpcname,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/S3Service.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/S3Service.go deleted file mode 100644 index d2cbb9326..000000000 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/S3Service.go +++ /dev/null @@ -1,281 +0,0 @@ -// -// Copyright 2014, Sander van Harmelen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package cloudstack - -import ( - "encoding/json" - "fmt" - "net/url" - "strconv" -) - -type AddS3Params struct { - p map[string]interface{} -} - -func (p *AddS3Params) toURLValues() url.Values { - u := url.Values{} - if p.p == nil { - return u - } - if v, found := p.p["accesskey"]; found { - u.Set("accesskey", v.(string)) - } - if v, found := p.p["bucket"]; found { - u.Set("bucket", v.(string)) - } - if v, found := p.p["connectiontimeout"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("connectiontimeout", vv) - } - if v, found := p.p["endpoint"]; found { - u.Set("endpoint", v.(string)) - } - if v, found := p.p["maxerrorretry"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("maxerrorretry", vv) - } - if v, found := p.p["secretkey"]; found { - u.Set("secretkey", v.(string)) - } - if v, found := p.p["sockettimeout"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("sockettimeout", vv) - } - if v, found := p.p["usehttps"]; found { - vv := strconv.FormatBool(v.(bool)) - u.Set("usehttps", vv) - } - return u -} - -func (p *AddS3Params) SetAccesskey(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["accesskey"] = v - return -} - -func (p *AddS3Params) SetBucket(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["bucket"] = v - return -} - -func (p *AddS3Params) SetConnectiontimeout(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["connectiontimeout"] = v - return -} - -func (p *AddS3Params) SetEndpoint(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["endpoint"] = v - return -} - -func (p *AddS3Params) SetMaxerrorretry(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["maxerrorretry"] = v - return -} - -func (p *AddS3Params) SetSecretkey(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["secretkey"] = v - return -} - -func (p *AddS3Params) SetSockettimeout(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["sockettimeout"] = v - return -} - -func (p *AddS3Params) SetUsehttps(v bool) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["usehttps"] = v - return -} - -// You should always use this function to get a new AddS3Params instance, -// as then you are sure you have configured all required params -func (s *S3Service) NewAddS3Params(accesskey string, bucket string, secretkey string) *AddS3Params { - p := &AddS3Params{} - p.p = make(map[string]interface{}) - p.p["accesskey"] = accesskey - p.p["bucket"] = bucket - p.p["secretkey"] = secretkey - return p -} - -// Adds S3 -func (s *S3Service) AddS3(p *AddS3Params) (*AddS3Response, error) { - resp, err := s.cs.newRequest("addS3", p.toURLValues()) - if err != nil { - return nil, err - } - - var r AddS3Response - if err := json.Unmarshal(resp, &r); err != nil { - return nil, err - } - return &r, nil -} - -type AddS3Response struct { - Details []string `json:"details,omitempty"` - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Protocol string `json:"protocol,omitempty"` - Providername string `json:"providername,omitempty"` - Scope string `json:"scope,omitempty"` - Url string `json:"url,omitempty"` - Zoneid string `json:"zoneid,omitempty"` - Zonename string `json:"zonename,omitempty"` -} - -type ListS3sParams struct { - p map[string]interface{} -} - -func (p *ListS3sParams) toURLValues() url.Values { - u := url.Values{} - if p.p == nil { - return u - } - if v, found := p.p["keyword"]; found { - u.Set("keyword", v.(string)) - } - if v, found := p.p["page"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("page", vv) - } - if v, found := p.p["pagesize"]; found { - vv := strconv.Itoa(v.(int)) - u.Set("pagesize", vv) - } - return u -} - -func (p *ListS3sParams) SetKeyword(v string) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["keyword"] = v - return -} - -func (p *ListS3sParams) SetPage(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["page"] = v - return -} - -func (p *ListS3sParams) SetPagesize(v int) { - if p.p == nil { - p.p = make(map[string]interface{}) - } - p.p["pagesize"] = v - return -} - -// You should always use this function to get a new ListS3sParams instance, -// as then you are sure you have configured all required params -func (s *S3Service) NewListS3sParams() *ListS3sParams { - p := &ListS3sParams{} - p.p = make(map[string]interface{}) - return p -} - -// This is a courtesy helper function, which in some cases may not work as expected! -func (s *S3Service) GetS3ID(keyword string) (string, error) { - p := &ListS3sParams{} - p.p = make(map[string]interface{}) - - p.p["keyword"] = keyword - - l, err := s.ListS3s(p) - if err != nil { - return "", err - } - - if l.Count == 0 { - return "", fmt.Errorf("No match found for %s: %+v", keyword, l) - } - - if l.Count == 1 { - return l.S3s[0].Id, nil - } - - if l.Count > 1 { - for _, v := range l.S3s { - if v.Name == keyword { - return v.Id, nil - } - } - } - return "", fmt.Errorf("Could not find an exact match for %s: %+v", keyword, l) -} - -// Lists S3s -func (s *S3Service) ListS3s(p *ListS3sParams) (*ListS3sResponse, error) { - resp, err := s.cs.newRequest("listS3s", p.toURLValues()) - if err != nil { - return nil, err - } - - var r ListS3sResponse - if err := json.Unmarshal(resp, &r); err != nil { - return nil, err - } - return &r, nil -} - -type ListS3sResponse struct { - Count int `json:"count"` - S3s []*S3 `json:"s3"` -} - -type S3 struct { - Details []string `json:"details,omitempty"` - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Protocol string `json:"protocol,omitempty"` - Providername string `json:"providername,omitempty"` - Scope string `json:"scope,omitempty"` - Url string `json:"url,omitempty"` - Zoneid string `json:"zoneid,omitempty"` - Zonename string `json:"zonename,omitempty"` -} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SSHService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SSHService.go index eb97dfcb8..97eabc0d1 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SSHService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SSHService.go @@ -143,6 +143,8 @@ type ResetSSHKeyForVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -279,6 +281,8 @@ type ResetSSHKeyForVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -299,6 +303,8 @@ type ResetSSHKeyForVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -400,6 +406,9 @@ func (s *SSHService) RegisterSSHKeyPair(p *RegisterSSHKeyPairParams) (*RegisterS } type RegisterSSHKeyPairResponse struct { + Account string `json:"account,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Name string `json:"name,omitempty"` } @@ -729,6 +738,9 @@ type ListSSHKeyPairsResponse struct { } type SSHKeyPair struct { + Account string `json:"account,omitempty"` + Domain string `json:"domain,omitempty"` + Domainid string `json:"domainid,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Name string `json:"name,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SecurityGroupService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SecurityGroupService.go index 282cd64bd..73b100cbe 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SecurityGroupService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SecurityGroupService.go @@ -181,6 +181,8 @@ type CreateSecurityGroupResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } type DeleteSecurityGroupParams struct { @@ -1196,4 +1198,6 @@ type SecurityGroup struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ServiceOfferingService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ServiceOfferingService.go index 500064d8f..ed50703eb 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ServiceOfferingService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ServiceOfferingService.go @@ -112,6 +112,9 @@ func (p *CreateServiceOfferingParams) toURLValues() url.Values { vv := strconv.FormatBool(v.(bool)) u.Set("offerha", vv) } + if v, found := p.p["provisioningtype"]; found { + u.Set("provisioningtype", v.(string)) + } if v, found := p.p["serviceofferingdetails"]; found { i := 0 for k, vv := range v.(map[string]string) { @@ -300,6 +303,14 @@ func (p *CreateServiceOfferingParams) SetOfferha(v bool) { return } +func (p *CreateServiceOfferingParams) SetProvisioningtype(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["provisioningtype"] = v + return +} + func (p *CreateServiceOfferingParams) SetServiceofferingdetails(v map[string]string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -387,6 +398,7 @@ type CreateServiceOfferingResponse struct { Name string `json:"name,omitempty"` Networkrate int `json:"networkrate,omitempty"` Offerha bool `json:"offerha,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Serviceofferingdetails map[string]string `json:"serviceofferingdetails,omitempty"` Storagetype string `json:"storagetype,omitempty"` Systemvmtype string `json:"systemvmtype,omitempty"` @@ -551,6 +563,7 @@ type UpdateServiceOfferingResponse struct { Name string `json:"name,omitempty"` Networkrate int `json:"networkrate,omitempty"` Offerha bool `json:"offerha,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Serviceofferingdetails map[string]string `json:"serviceofferingdetails,omitempty"` Storagetype string `json:"storagetype,omitempty"` Systemvmtype string `json:"systemvmtype,omitempty"` @@ -572,6 +585,10 @@ func (p *ListServiceOfferingsParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } + if v, found := p.p["isrecursive"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isrecursive", vv) + } if v, found := p.p["issystem"]; found { vv := strconv.FormatBool(v.(bool)) u.Set("issystem", vv) @@ -579,6 +596,10 @@ func (p *ListServiceOfferingsParams) toURLValues() url.Values { if v, found := p.p["keyword"]; found { u.Set("keyword", v.(string)) } + if v, found := p.p["listall"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("listall", vv) + } if v, found := p.p["name"]; found { u.Set("name", v.(string)) } @@ -615,6 +636,14 @@ func (p *ListServiceOfferingsParams) SetId(v string) { return } +func (p *ListServiceOfferingsParams) SetIsrecursive(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isrecursive"] = v + return +} + func (p *ListServiceOfferingsParams) SetIssystem(v bool) { if p.p == nil { p.p = make(map[string]interface{}) @@ -631,6 +660,14 @@ func (p *ListServiceOfferingsParams) SetKeyword(v string) { return } +func (p *ListServiceOfferingsParams) SetListall(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["listall"] = v + return +} + func (p *ListServiceOfferingsParams) SetName(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -796,6 +833,7 @@ type ServiceOffering struct { Name string `json:"name,omitempty"` Networkrate int `json:"networkrate,omitempty"` Offerha bool `json:"offerha,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Serviceofferingdetails map[string]string `json:"serviceofferingdetails,omitempty"` Storagetype string `json:"storagetype,omitempty"` Systemvmtype string `json:"systemvmtype,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SnapshotService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SnapshotService.go index 0b23ad1e7..dab17eeea 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SnapshotService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SnapshotService.go @@ -39,6 +39,9 @@ func (p *CreateSnapshotParams) toURLValues() url.Values { if v, found := p.p["domainid"]; found { u.Set("domainid", v.(string)) } + if v, found := p.p["name"]; found { + u.Set("name", v.(string)) + } if v, found := p.p["policyid"]; found { u.Set("policyid", v.(string)) } @@ -68,6 +71,14 @@ func (p *CreateSnapshotParams) SetDomainid(v string) { return } +func (p *CreateSnapshotParams) SetName(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["name"] = v + return +} + func (p *CreateSnapshotParams) SetPolicyid(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -144,6 +155,7 @@ type CreateSnapshotResponse struct { Id string `json:"id,omitempty"` Intervaltype string `json:"intervaltype,omitempty"` Name string `json:"name,omitempty"` + Physicalsize int64 `json:"physicalsize,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` Revertable bool `json:"revertable,omitempty"` @@ -484,6 +496,7 @@ type Snapshot struct { Id string `json:"id,omitempty"` Intervaltype string `json:"intervaltype,omitempty"` Name string `json:"name,omitempty"` + Physicalsize int64 `json:"physicalsize,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` Revertable bool `json:"revertable,omitempty"` @@ -1072,6 +1085,7 @@ type RevertSnapshotResponse struct { Id string `json:"id,omitempty"` Intervaltype string `json:"intervaltype,omitempty"` Name string `json:"name,omitempty"` + Physicalsize int64 `json:"physicalsize,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` Revertable bool `json:"revertable,omitempty"` @@ -1622,6 +1636,8 @@ type RevertToVMSnapshotResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -1758,6 +1774,8 @@ type RevertToVMSnapshotResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -1778,6 +1796,8 @@ type RevertToVMSnapshotResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SystemVMService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SystemVMService.go index 35369654e..5bea9ad18 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/SystemVMService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/SystemVMService.go @@ -99,6 +99,7 @@ type StartSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -196,6 +197,7 @@ type RebootSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -305,6 +307,7 @@ type StopSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -402,6 +405,7 @@ type DestroySystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -665,6 +669,7 @@ type SystemVm struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -774,6 +779,7 @@ type MigrateSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -878,6 +884,7 @@ type ChangeServiceForSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` @@ -1003,6 +1010,7 @@ type ScaleSystemVmResponse struct { Gateway string `json:"gateway,omitempty"` Hostid string `json:"hostid,omitempty"` Hostname string `json:"hostname,omitempty"` + Hypervisor string `json:"hypervisor,omitempty"` Id string `json:"id,omitempty"` Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/TemplateService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/TemplateService.go index 860e59203..d07dd9206 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/TemplateService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/TemplateService.go @@ -70,6 +70,9 @@ func (p *CreateTemplateParams) toURLValues() url.Values { vv := strconv.FormatBool(v.(bool)) u.Set("passwordenabled", vv) } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } if v, found := p.p["requireshvm"]; found { vv := strconv.FormatBool(v.(bool)) u.Set("requireshvm", vv) @@ -164,6 +167,14 @@ func (p *CreateTemplateParams) SetPasswordenabled(v bool) { return } +func (p *CreateTemplateParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + func (p *CreateTemplateParams) SetRequireshvm(v bool) { if p.p == nil { p.p = make(map[string]interface{}) @@ -708,6 +719,10 @@ func (p *UpdateTemplateParams) toURLValues() url.Values { vv := strconv.FormatBool(v.(bool)) u.Set("passwordenabled", vv) } + if v, found := p.p["requireshvm"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("requireshvm", vv) + } if v, found := p.p["sortkey"]; found { vv := strconv.Itoa(v.(int)) u.Set("sortkey", vv) @@ -795,6 +810,14 @@ func (p *UpdateTemplateParams) SetPasswordenabled(v bool) { return } +func (p *UpdateTemplateParams) SetRequireshvm(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["requireshvm"] = v + return +} + func (p *UpdateTemplateParams) SetSortkey(v int) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1794,6 +1817,9 @@ func (p *PrepareTemplateParams) toURLValues() url.Values { if p.p == nil { return u } + if v, found := p.p["storageid"]; found { + u.Set("storageid", v.(string)) + } if v, found := p.p["templateid"]; found { u.Set("templateid", v.(string)) } @@ -1803,6 +1829,14 @@ func (p *PrepareTemplateParams) toURLValues() url.Values { return u } +func (p *PrepareTemplateParams) SetStorageid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["storageid"] = v + return +} + func (p *PrepareTemplateParams) SetTemplateid(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1997,3 +2031,296 @@ type UpgradeRouterTemplateResponse struct { Jobid string `json:"jobid,omitempty"` Jobstatus int `json:"jobstatus,omitempty"` } + +type GetUploadParamsForTemplateParams struct { + p map[string]interface{} +} + +func (p *GetUploadParamsForTemplateParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["account"]; found { + u.Set("account", v.(string)) + } + if v, found := p.p["bits"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("bits", vv) + } + if v, found := p.p["checksum"]; found { + u.Set("checksum", v.(string)) + } + if v, found := p.p["details"]; found { + i := 0 + for k, vv := range v.(map[string]string) { + u.Set(fmt.Sprintf("details[%d].key", i), k) + u.Set(fmt.Sprintf("details[%d].value", i), vv) + i++ + } + } + if v, found := p.p["displaytext"]; found { + u.Set("displaytext", v.(string)) + } + if v, found := p.p["domainid"]; found { + u.Set("domainid", v.(string)) + } + if v, found := p.p["format"]; found { + u.Set("format", v.(string)) + } + if v, found := p.p["hypervisor"]; found { + u.Set("hypervisor", v.(string)) + } + if v, found := p.p["isdynamicallyscalable"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isdynamicallyscalable", vv) + } + if v, found := p.p["isextractable"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isextractable", vv) + } + if v, found := p.p["isfeatured"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isfeatured", vv) + } + if v, found := p.p["ispublic"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("ispublic", vv) + } + if v, found := p.p["isrouting"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("isrouting", vv) + } + if v, found := p.p["name"]; found { + u.Set("name", v.(string)) + } + if v, found := p.p["ostypeid"]; found { + u.Set("ostypeid", v.(string)) + } + if v, found := p.p["passwordenabled"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("passwordenabled", vv) + } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } + if v, found := p.p["requireshvm"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("requireshvm", vv) + } + if v, found := p.p["sshkeyenabled"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("sshkeyenabled", vv) + } + if v, found := p.p["templatetag"]; found { + u.Set("templatetag", v.(string)) + } + if v, found := p.p["zoneid"]; found { + u.Set("zoneid", v.(string)) + } + return u +} + +func (p *GetUploadParamsForTemplateParams) SetAccount(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["account"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetBits(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["bits"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetChecksum(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["checksum"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetDetails(v map[string]string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["details"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetDisplaytext(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["displaytext"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetDomainid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domainid"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetFormat(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["format"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetHypervisor(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["hypervisor"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetIsdynamicallyscalable(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isdynamicallyscalable"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetIsextractable(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isextractable"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetIsfeatured(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isfeatured"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetIspublic(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ispublic"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetIsrouting(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["isrouting"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetName(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["name"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetOstypeid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ostypeid"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetPasswordenabled(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["passwordenabled"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetRequireshvm(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["requireshvm"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetSshkeyenabled(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["sshkeyenabled"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetTemplatetag(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["templatetag"] = v + return +} + +func (p *GetUploadParamsForTemplateParams) SetZoneid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["zoneid"] = v + return +} + +// You should always use this function to get a new GetUploadParamsForTemplateParams instance, +// as then you are sure you have configured all required params +func (s *TemplateService) NewGetUploadParamsForTemplateParams(displaytext string, format string, hypervisor string, name string, ostypeid string, zoneid string) *GetUploadParamsForTemplateParams { + p := &GetUploadParamsForTemplateParams{} + p.p = make(map[string]interface{}) + p.p["displaytext"] = displaytext + p.p["format"] = format + p.p["hypervisor"] = hypervisor + p.p["name"] = name + p.p["ostypeid"] = ostypeid + p.p["zoneid"] = zoneid + return p +} + +// upload an existing template into the CloudStack cloud. +func (s *TemplateService) GetUploadParamsForTemplate(p *GetUploadParamsForTemplateParams) (*GetUploadParamsForTemplateResponse, error) { + resp, err := s.cs.newRequest("getUploadParamsForTemplate", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetUploadParamsForTemplateResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetUploadParamsForTemplateResponse struct { + Expires string `json:"expires,omitempty"` + Id string `json:"id,omitempty"` + Metadata string `json:"metadata,omitempty"` + PostURL string `json:"postURL,omitempty"` + Signature string `json:"signature,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/UsageService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/UsageService.go index ea468e1cb..a25592042 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/UsageService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/UsageService.go @@ -41,6 +41,9 @@ func (p *AddTrafficTypeParams) toURLValues() url.Values { if v, found := p.p["kvmnetworklabel"]; found { u.Set("kvmnetworklabel", v.(string)) } + if v, found := p.p["ovm3networklabel"]; found { + u.Set("ovm3networklabel", v.(string)) + } if v, found := p.p["physicalnetworkid"]; found { u.Set("physicalnetworkid", v.(string)) } @@ -83,6 +86,14 @@ func (p *AddTrafficTypeParams) SetKvmnetworklabel(v string) { return } +func (p *AddTrafficTypeParams) SetOvm3networklabel(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ovm3networklabel"] = v + return +} + func (p *AddTrafficTypeParams) SetPhysicalnetworkid(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -172,6 +183,7 @@ type AddTrafficTypeResponse struct { Hypervnetworklabel string `json:"hypervnetworklabel,omitempty"` Id string `json:"id,omitempty"` Kvmnetworklabel string `json:"kvmnetworklabel,omitempty"` + Ovm3networklabel string `json:"ovm3networklabel,omitempty"` Physicalnetworkid string `json:"physicalnetworkid,omitempty"` Traffictype string `json:"traffictype,omitempty"` Vmwarenetworklabel string `json:"vmwarenetworklabel,omitempty"` @@ -390,6 +402,9 @@ func (p *UpdateTrafficTypeParams) toURLValues() url.Values { if v, found := p.p["kvmnetworklabel"]; found { u.Set("kvmnetworklabel", v.(string)) } + if v, found := p.p["ovm3networklabel"]; found { + u.Set("ovm3networklabel", v.(string)) + } if v, found := p.p["vmwarenetworklabel"]; found { u.Set("vmwarenetworklabel", v.(string)) } @@ -423,6 +438,14 @@ func (p *UpdateTrafficTypeParams) SetKvmnetworklabel(v string) { return } +func (p *UpdateTrafficTypeParams) SetOvm3networklabel(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["ovm3networklabel"] = v + return +} + func (p *UpdateTrafficTypeParams) SetVmwarenetworklabel(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -487,6 +510,7 @@ type UpdateTrafficTypeResponse struct { Hypervnetworklabel string `json:"hypervnetworklabel,omitempty"` Id string `json:"id,omitempty"` Kvmnetworklabel string `json:"kvmnetworklabel,omitempty"` + Ovm3networklabel string `json:"ovm3networklabel,omitempty"` Physicalnetworkid string `json:"physicalnetworkid,omitempty"` Traffictype string `json:"traffictype,omitempty"` Vmwarenetworklabel string `json:"vmwarenetworklabel,omitempty"` @@ -699,6 +723,9 @@ func (p *ListUsageRecordsParams) toURLValues() url.Values { vv := strconv.FormatInt(v.(int64), 10) u.Set("type", vv) } + if v, found := p.p["usageid"]; found { + u.Set("usageid", v.(string)) + } return u } @@ -782,6 +809,14 @@ func (p *ListUsageRecordsParams) SetType(v int64) { return } +func (p *ListUsageRecordsParams) SetUsageid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["usageid"] = v + return +} + // You should always use this function to get a new ListUsageRecordsParams instance, // as then you are sure you have configured all required params func (s *UsageService) NewListUsageRecordsParams(enddate string, startdate string) *ListUsageRecordsParams { @@ -886,6 +921,58 @@ type UsageType struct { Usagetypeid int `json:"usagetypeid,omitempty"` } +type RemoveRawUsageRecordsParams struct { + p map[string]interface{} +} + +func (p *RemoveRawUsageRecordsParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["interval"]; found { + vv := strconv.Itoa(v.(int)) + u.Set("interval", vv) + } + return u +} + +func (p *RemoveRawUsageRecordsParams) SetInterval(v int) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["interval"] = v + return +} + +// You should always use this function to get a new RemoveRawUsageRecordsParams instance, +// as then you are sure you have configured all required params +func (s *UsageService) NewRemoveRawUsageRecordsParams(interval int) *RemoveRawUsageRecordsParams { + p := &RemoveRawUsageRecordsParams{} + p.p = make(map[string]interface{}) + p.p["interval"] = interval + return p +} + +// Safely removes raw records from cloud_usage table +func (s *UsageService) RemoveRawUsageRecords(p *RemoveRawUsageRecordsParams) (*RemoveRawUsageRecordsResponse, error) { + resp, err := s.cs.newRequest("removeRawUsageRecords", p.toURLValues()) + if err != nil { + return nil, err + } + + var r RemoveRawUsageRecordsResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type RemoveRawUsageRecordsResponse struct { + Displaytext string `json:"displaytext,omitempty"` + Success string `json:"success,omitempty"` +} + type AddTrafficMonitorParams struct { p map[string]interface{} } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPCService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPCService.go index 956bbbc46..c87e16e4f 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPCService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPCService.go @@ -295,12 +295,13 @@ type CreateVPCResponse struct { Zonename string `json:"zonename,omitempty"` Zonesnetworkspans []string `json:"zonesnetworkspans,omitempty"` } `json:"network,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Project string `json:"project,omitempty"` - Projectid string `json:"projectid,omitempty"` - Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` - Restartrequired bool `json:"restartrequired,omitempty"` - Service []struct { + Networkdomain string `json:"networkdomain,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Redundantvpcrouter bool `json:"redundantvpcrouter,omitempty"` + Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` + Restartrequired bool `json:"restartrequired,omitempty"` + Service []struct { Capability []struct { Canchooseservicecapability bool `json:"canchooseservicecapability,omitempty"` Name string `json:"name,omitempty"` @@ -779,12 +780,13 @@ type VPC struct { Zonename string `json:"zonename,omitempty"` Zonesnetworkspans []string `json:"zonesnetworkspans,omitempty"` } `json:"network,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Project string `json:"project,omitempty"` - Projectid string `json:"projectid,omitempty"` - Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` - Restartrequired bool `json:"restartrequired,omitempty"` - Service []struct { + Networkdomain string `json:"networkdomain,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Redundantvpcrouter bool `json:"redundantvpcrouter,omitempty"` + Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` + Restartrequired bool `json:"restartrequired,omitempty"` + Service []struct { Capability []struct { Canchooseservicecapability bool `json:"canchooseservicecapability,omitempty"` Name string `json:"name,omitempty"` @@ -1086,12 +1088,13 @@ type UpdateVPCResponse struct { Zonename string `json:"zonename,omitempty"` Zonesnetworkspans []string `json:"zonesnetworkspans,omitempty"` } `json:"network,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Project string `json:"project,omitempty"` - Projectid string `json:"projectid,omitempty"` - Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` - Restartrequired bool `json:"restartrequired,omitempty"` - Service []struct { + Networkdomain string `json:"networkdomain,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Redundantvpcrouter bool `json:"redundantvpcrouter,omitempty"` + Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` + Restartrequired bool `json:"restartrequired,omitempty"` + Service []struct { Capability []struct { Canchooseservicecapability bool `json:"canchooseservicecapability,omitempty"` Name string `json:"name,omitempty"` @@ -1135,12 +1138,28 @@ func (p *RestartVPCParams) toURLValues() url.Values { if p.p == nil { return u } + if v, found := p.p["cleanup"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("cleanup", vv) + } if v, found := p.p["id"]; found { u.Set("id", v.(string)) } + if v, found := p.p["makeredundant"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("makeredundant", vv) + } return u } +func (p *RestartVPCParams) SetCleanup(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["cleanup"] = v + return +} + func (p *RestartVPCParams) SetId(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1149,6 +1168,14 @@ func (p *RestartVPCParams) SetId(v string) { return } +func (p *RestartVPCParams) SetMakeredundant(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["makeredundant"] = v + return +} + // You should always use this function to get a new RestartVPCParams instance, // as then you are sure you have configured all required params func (s *VPCService) NewRestartVPCParams(id string) *RestartVPCParams { @@ -1281,12 +1308,13 @@ type RestartVPCResponse struct { Zonename string `json:"zonename,omitempty"` Zonesnetworkspans []string `json:"zonesnetworkspans,omitempty"` } `json:"network,omitempty"` - Networkdomain string `json:"networkdomain,omitempty"` - Project string `json:"project,omitempty"` - Projectid string `json:"projectid,omitempty"` - Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` - Restartrequired bool `json:"restartrequired,omitempty"` - Service []struct { + Networkdomain string `json:"networkdomain,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` + Redundantvpcrouter bool `json:"redundantvpcrouter,omitempty"` + Regionlevelvpc bool `json:"regionlevelvpc,omitempty"` + Restartrequired bool `json:"restartrequired,omitempty"` + Service []struct { Capability []struct { Canchooseservicecapability bool `json:"canchooseservicecapability,omitempty"` Name string `json:"name,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPNService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPNService.go index 37550c4eb..26b7fdec0 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPNService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VPNService.go @@ -1026,6 +1026,10 @@ func (p *CreateVpnCustomerGatewayParams) toURLValues() url.Values { if v, found := p.p["esppolicy"]; found { u.Set("esppolicy", v.(string)) } + if v, found := p.p["forceencap"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("forceencap", vv) + } if v, found := p.p["gateway"]; found { u.Set("gateway", v.(string)) } @@ -1042,6 +1046,9 @@ func (p *CreateVpnCustomerGatewayParams) toURLValues() url.Values { if v, found := p.p["name"]; found { u.Set("name", v.(string)) } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } return u } @@ -1093,6 +1100,14 @@ func (p *CreateVpnCustomerGatewayParams) SetEsppolicy(v string) { return } +func (p *CreateVpnCustomerGatewayParams) SetForceencap(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["forceencap"] = v + return +} + func (p *CreateVpnCustomerGatewayParams) SetGateway(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1133,6 +1148,14 @@ func (p *CreateVpnCustomerGatewayParams) SetName(v string) { return } +func (p *CreateVpnCustomerGatewayParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + // You should always use this function to get a new CreateVpnCustomerGatewayParams instance, // as then you are sure you have configured all required params func (s *VPNService) NewCreateVpnCustomerGatewayParams(cidrlist string, esppolicy string, gateway string, ikepolicy string, ipsecpsk string) *CreateVpnCustomerGatewayParams { @@ -1189,6 +1212,7 @@ type CreateVpnCustomerGatewayResponse struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` Ikelifetime int64 `json:"ikelifetime,omitempty"` @@ -1405,6 +1429,7 @@ type CreateVpnConnectionResponse struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` @@ -1651,6 +1676,10 @@ func (p *UpdateVpnCustomerGatewayParams) toURLValues() url.Values { if v, found := p.p["esppolicy"]; found { u.Set("esppolicy", v.(string)) } + if v, found := p.p["forceencap"]; found { + vv := strconv.FormatBool(v.(bool)) + u.Set("forceencap", vv) + } if v, found := p.p["gateway"]; found { u.Set("gateway", v.(string)) } @@ -1721,6 +1750,14 @@ func (p *UpdateVpnCustomerGatewayParams) SetEsppolicy(v string) { return } +func (p *UpdateVpnCustomerGatewayParams) SetForceencap(v bool) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["forceencap"] = v + return +} + func (p *UpdateVpnCustomerGatewayParams) SetGateway(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1826,6 +1863,7 @@ type UpdateVpnCustomerGatewayResponse struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` Ikelifetime int64 `json:"ikelifetime,omitempty"` @@ -1936,6 +1974,7 @@ type ResetVpnConnectionResponse struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` @@ -2198,6 +2237,7 @@ type VpnCustomerGateway struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` Ikelifetime int64 `json:"ikelifetime,omitempty"` @@ -2646,6 +2686,7 @@ type VpnConnection struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` @@ -2761,6 +2802,7 @@ type UpdateVpnConnectionResponse struct { Dpd bool `json:"dpd,omitempty"` Esplifetime int64 `json:"esplifetime,omitempty"` Esppolicy string `json:"esppolicy,omitempty"` + Forceencap bool `json:"forceencap,omitempty"` Fordisplay bool `json:"fordisplay,omitempty"` Gateway string `json:"gateway,omitempty"` Id string `json:"id,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VirtualMachineService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VirtualMachineService.go index 2265e0b91..d3a43fa96 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VirtualMachineService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VirtualMachineService.go @@ -440,6 +440,8 @@ type DeployVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -576,6 +578,8 @@ type DeployVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -596,6 +600,8 @@ type DeployVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -645,7 +651,7 @@ func (s *VirtualMachineService) NewDestroyVirtualMachineParams(id string) *Destr return p } -// Destroys a virtual machine. Once destroyed, only the administrator can recover it. +// Destroys a virtual machine. func (s *VirtualMachineService) DestroyVirtualMachine(p *DestroyVirtualMachineParams) (*DestroyVirtualMachineResponse, error) { resp, err := s.cs.newRequest("destroyVirtualMachine", p.toURLValues()) if err != nil { @@ -689,6 +695,8 @@ type DestroyVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -825,6 +833,8 @@ type DestroyVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -845,6 +855,8 @@ type DestroyVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -926,6 +938,8 @@ type RebootVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -1062,6 +1076,8 @@ type RebootVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -1082,6 +1098,8 @@ type RebootVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -1185,6 +1203,8 @@ type StartVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -1321,6 +1341,8 @@ type StartVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -1341,6 +1363,8 @@ type StartVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -1434,6 +1458,8 @@ type StopVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -1570,6 +1596,8 @@ type StopVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -1590,6 +1618,8 @@ type StopVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -1671,6 +1701,8 @@ type ResetPasswordForVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -1807,6 +1839,8 @@ type ResetPasswordForVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -1827,6 +1861,8 @@ type ResetPasswordForVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -1869,6 +1905,9 @@ func (p *UpdateVirtualMachineParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } + if v, found := p.p["instancename"]; found { + u.Set("instancename", v.(string)) + } if v, found := p.p["isdynamicallyscalable"]; found { vv := strconv.FormatBool(v.(bool)) u.Set("isdynamicallyscalable", vv) @@ -1941,6 +1980,14 @@ func (p *UpdateVirtualMachineParams) SetId(v string) { return } +func (p *UpdateVirtualMachineParams) SetInstancename(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["instancename"] = v + return +} + func (p *UpdateVirtualMachineParams) SetIsdynamicallyscalable(v bool) { if p.p == nil { p.p = make(map[string]interface{}) @@ -2005,6 +2052,8 @@ type UpdateVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -2141,6 +2190,8 @@ type UpdateVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -2161,6 +2212,8 @@ type UpdateVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -2222,6 +2275,9 @@ func (p *ListVirtualMachinesParams) toURLValues() url.Values { vv := strconv.FormatBool(v.(bool)) u.Set("isrecursive", vv) } + if v, found := p.p["keypair"]; found { + u.Set("keypair", v.(string)) + } if v, found := p.p["keyword"]; found { u.Set("keyword", v.(string)) } @@ -2275,6 +2331,9 @@ func (p *ListVirtualMachinesParams) toURLValues() url.Values { if v, found := p.p["templateid"]; found { u.Set("templateid", v.(string)) } + if v, found := p.p["userid"]; found { + u.Set("userid", v.(string)) + } if v, found := p.p["vpcid"]; found { u.Set("vpcid", v.(string)) } @@ -2388,6 +2447,14 @@ func (p *ListVirtualMachinesParams) SetIsrecursive(v bool) { return } +func (p *ListVirtualMachinesParams) SetKeypair(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["keypair"] = v + return +} + func (p *ListVirtualMachinesParams) SetKeyword(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -2492,6 +2559,14 @@ func (p *ListVirtualMachinesParams) SetTemplateid(v string) { return } +func (p *ListVirtualMachinesParams) SetUserid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["userid"] = v + return +} + func (p *ListVirtualMachinesParams) SetVpcid(v string) { if p.p == nil { p.p = make(map[string]interface{}) @@ -2640,6 +2715,8 @@ type VirtualMachine struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -2776,6 +2853,8 @@ type VirtualMachine struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -2796,6 +2875,8 @@ type VirtualMachine struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -2938,6 +3019,8 @@ type RestoreVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -3074,6 +3157,8 @@ type RestoreVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -3094,6 +3179,8 @@ type RestoreVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -3182,6 +3269,8 @@ type ChangeServiceForVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -3318,6 +3407,8 @@ type ChangeServiceForVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -3338,6 +3429,8 @@ type ChangeServiceForVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -3541,6 +3634,8 @@ type AssignVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -3677,6 +3772,8 @@ type AssignVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -3697,6 +3794,8 @@ type AssignVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -3800,6 +3899,8 @@ type MigrateVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -3936,6 +4037,8 @@ type MigrateVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -3956,6 +4059,8 @@ type MigrateVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -4065,6 +4170,8 @@ type MigrateVirtualMachineWithVolumeResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -4201,6 +4308,8 @@ type MigrateVirtualMachineWithVolumeResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -4221,6 +4330,8 @@ type MigrateVirtualMachineWithVolumeResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -4281,6 +4392,8 @@ type RecoverVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -4417,6 +4530,8 @@ type RecoverVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -4437,6 +4552,8 @@ type RecoverVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -4663,6 +4780,8 @@ type AddNicToVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -4799,6 +4918,8 @@ type AddNicToVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -4819,6 +4940,8 @@ type AddNicToVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -4912,6 +5035,8 @@ type RemoveNicFromVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -5048,6 +5173,8 @@ type RemoveNicFromVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -5068,6 +5195,8 @@ type RemoveNicFromVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` @@ -5161,6 +5290,8 @@ type UpdateDefaultNicForVirtualMachineResponse struct { Domainid string `json:"domainid,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` + Project string `json:"project,omitempty"` + Projectid string `json:"projectid,omitempty"` Type string `json:"type,omitempty"` VirtualmachineIds []string `json:"virtualmachineIds,omitempty"` } `json:"affinitygroup,omitempty"` @@ -5297,6 +5428,8 @@ type UpdateDefaultNicForVirtualMachineResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` + Virtualmachinecount int `json:"virtualmachinecount,omitempty"` + Virtualmachineids []string `json:"virtualmachineids,omitempty"` } `json:"securitygroup,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` Serviceofferingname string `json:"serviceofferingname,omitempty"` @@ -5317,6 +5450,8 @@ type UpdateDefaultNicForVirtualMachineResponse struct { Templatedisplaytext string `json:"templatedisplaytext,omitempty"` Templateid string `json:"templateid,omitempty"` Templatename string `json:"templatename,omitempty"` + Userid string `json:"userid,omitempty"` + Username string `json:"username,omitempty"` Vgpu string `json:"vgpu,omitempty"` Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VolumeService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VolumeService.go index eb4a7c460..7fbf81f0c 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/VolumeService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/VolumeService.go @@ -144,6 +144,7 @@ type AttachVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -377,6 +378,7 @@ type UploadVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -530,6 +532,7 @@ type DetachVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -726,10 +729,9 @@ func (p *CreateVolumeParams) SetZoneid(v string) { // You should always use this function to get a new CreateVolumeParams instance, // as then you are sure you have configured all required params -func (s *VolumeService) NewCreateVolumeParams(name string) *CreateVolumeParams { +func (s *VolumeService) NewCreateVolumeParams() *CreateVolumeParams { p := &CreateVolumeParams{} p.p = make(map[string]interface{}) - p.p["name"] = name return p } @@ -797,6 +799,7 @@ type CreateVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -1266,6 +1269,7 @@ type Volume struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -1540,6 +1544,7 @@ type MigrateVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -1590,6 +1595,14 @@ func (p *ResizeVolumeParams) toURLValues() url.Values { if v, found := p.p["id"]; found { u.Set("id", v.(string)) } + if v, found := p.p["maxiops"]; found { + vv := strconv.FormatInt(v.(int64), 10) + u.Set("maxiops", vv) + } + if v, found := p.p["miniops"]; found { + vv := strconv.FormatInt(v.(int64), 10) + u.Set("miniops", vv) + } if v, found := p.p["shrinkok"]; found { vv := strconv.FormatBool(v.(bool)) u.Set("shrinkok", vv) @@ -1617,6 +1630,22 @@ func (p *ResizeVolumeParams) SetId(v string) { return } +func (p *ResizeVolumeParams) SetMaxiops(v int64) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["maxiops"] = v + return +} + +func (p *ResizeVolumeParams) SetMiniops(v int64) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["miniops"] = v + return +} + func (p *ResizeVolumeParams) SetShrinkok(v bool) { if p.p == nil { p.p = make(map[string]interface{}) @@ -1706,6 +1735,7 @@ type ResizeVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -1903,6 +1933,7 @@ type UpdateVolumeResponse struct { Path string `json:"path,omitempty"` Project string `json:"project,omitempty"` Projectid string `json:"projectid,omitempty"` + Provisioningtype string `json:"provisioningtype,omitempty"` Quiescevm bool `json:"quiescevm,omitempty"` Serviceofferingdisplaytext string `json:"serviceofferingdisplaytext,omitempty"` Serviceofferingid string `json:"serviceofferingid,omitempty"` @@ -1937,3 +1968,321 @@ type UpdateVolumeResponse struct { Zoneid string `json:"zoneid,omitempty"` Zonename string `json:"zonename,omitempty"` } + +type GetSolidFireVolumeSizeParams struct { + p map[string]interface{} +} + +func (p *GetSolidFireVolumeSizeParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["storageid"]; found { + u.Set("storageid", v.(string)) + } + if v, found := p.p["volumeid"]; found { + u.Set("volumeid", v.(string)) + } + return u +} + +func (p *GetSolidFireVolumeSizeParams) SetStorageid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["storageid"] = v + return +} + +func (p *GetSolidFireVolumeSizeParams) SetVolumeid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["volumeid"] = v + return +} + +// You should always use this function to get a new GetSolidFireVolumeSizeParams instance, +// as then you are sure you have configured all required params +func (s *VolumeService) NewGetSolidFireVolumeSizeParams(storageid string, volumeid string) *GetSolidFireVolumeSizeParams { + p := &GetSolidFireVolumeSizeParams{} + p.p = make(map[string]interface{}) + p.p["storageid"] = storageid + p.p["volumeid"] = volumeid + return p +} + +// Get the SF volume size including Hypervisor Snapshot Reserve +func (s *VolumeService) GetSolidFireVolumeSize(p *GetSolidFireVolumeSizeParams) (*GetSolidFireVolumeSizeResponse, error) { + resp, err := s.cs.newRequest("getSolidFireVolumeSize", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetSolidFireVolumeSizeResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetSolidFireVolumeSizeResponse struct { + SolidFireVolumeSize int64 `json:"solidFireVolumeSize,omitempty"` +} + +type GetSolidFireVolumeAccessGroupIdParams struct { + p map[string]interface{} +} + +func (p *GetSolidFireVolumeAccessGroupIdParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["clusterid"]; found { + u.Set("clusterid", v.(string)) + } + if v, found := p.p["storageid"]; found { + u.Set("storageid", v.(string)) + } + return u +} + +func (p *GetSolidFireVolumeAccessGroupIdParams) SetClusterid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["clusterid"] = v + return +} + +func (p *GetSolidFireVolumeAccessGroupIdParams) SetStorageid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["storageid"] = v + return +} + +// You should always use this function to get a new GetSolidFireVolumeAccessGroupIdParams instance, +// as then you are sure you have configured all required params +func (s *VolumeService) NewGetSolidFireVolumeAccessGroupIdParams(clusterid string, storageid string) *GetSolidFireVolumeAccessGroupIdParams { + p := &GetSolidFireVolumeAccessGroupIdParams{} + p.p = make(map[string]interface{}) + p.p["clusterid"] = clusterid + p.p["storageid"] = storageid + return p +} + +// Get the SF Volume Access Group ID +func (s *VolumeService) GetSolidFireVolumeAccessGroupId(p *GetSolidFireVolumeAccessGroupIdParams) (*GetSolidFireVolumeAccessGroupIdResponse, error) { + resp, err := s.cs.newRequest("getSolidFireVolumeAccessGroupId", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetSolidFireVolumeAccessGroupIdResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetSolidFireVolumeAccessGroupIdResponse struct { + SolidFireVolumeAccessGroupId int64 `json:"solidFireVolumeAccessGroupId,omitempty"` +} + +type GetSolidFireVolumeIscsiNameParams struct { + p map[string]interface{} +} + +func (p *GetSolidFireVolumeIscsiNameParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["volumeid"]; found { + u.Set("volumeid", v.(string)) + } + return u +} + +func (p *GetSolidFireVolumeIscsiNameParams) SetVolumeid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["volumeid"] = v + return +} + +// You should always use this function to get a new GetSolidFireVolumeIscsiNameParams instance, +// as then you are sure you have configured all required params +func (s *VolumeService) NewGetSolidFireVolumeIscsiNameParams(volumeid string) *GetSolidFireVolumeIscsiNameParams { + p := &GetSolidFireVolumeIscsiNameParams{} + p.p = make(map[string]interface{}) + p.p["volumeid"] = volumeid + return p +} + +// Get SolidFire Volume's Iscsi Name +func (s *VolumeService) GetSolidFireVolumeIscsiName(p *GetSolidFireVolumeIscsiNameParams) (*GetSolidFireVolumeIscsiNameResponse, error) { + resp, err := s.cs.newRequest("getSolidFireVolumeIscsiName", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetSolidFireVolumeIscsiNameResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetSolidFireVolumeIscsiNameResponse struct { + SolidFireVolumeIscsiName string `json:"solidFireVolumeIscsiName,omitempty"` +} + +type GetUploadParamsForVolumeParams struct { + p map[string]interface{} +} + +func (p *GetUploadParamsForVolumeParams) toURLValues() url.Values { + u := url.Values{} + if p.p == nil { + return u + } + if v, found := p.p["account"]; found { + u.Set("account", v.(string)) + } + if v, found := p.p["checksum"]; found { + u.Set("checksum", v.(string)) + } + if v, found := p.p["diskofferingid"]; found { + u.Set("diskofferingid", v.(string)) + } + if v, found := p.p["domainid"]; found { + u.Set("domainid", v.(string)) + } + if v, found := p.p["format"]; found { + u.Set("format", v.(string)) + } + if v, found := p.p["imagestoreuuid"]; found { + u.Set("imagestoreuuid", v.(string)) + } + if v, found := p.p["name"]; found { + u.Set("name", v.(string)) + } + if v, found := p.p["projectid"]; found { + u.Set("projectid", v.(string)) + } + if v, found := p.p["zoneid"]; found { + u.Set("zoneid", v.(string)) + } + return u +} + +func (p *GetUploadParamsForVolumeParams) SetAccount(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["account"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetChecksum(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["checksum"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetDiskofferingid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["diskofferingid"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetDomainid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["domainid"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetFormat(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["format"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetImagestoreuuid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["imagestoreuuid"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetName(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["name"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetProjectid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["projectid"] = v + return +} + +func (p *GetUploadParamsForVolumeParams) SetZoneid(v string) { + if p.p == nil { + p.p = make(map[string]interface{}) + } + p.p["zoneid"] = v + return +} + +// You should always use this function to get a new GetUploadParamsForVolumeParams instance, +// as then you are sure you have configured all required params +func (s *VolumeService) NewGetUploadParamsForVolumeParams(format string, name string, zoneid string) *GetUploadParamsForVolumeParams { + p := &GetUploadParamsForVolumeParams{} + p.p = make(map[string]interface{}) + p.p["format"] = format + p.p["name"] = name + p.p["zoneid"] = zoneid + return p +} + +// Upload a data disk to the cloudstack cloud. +func (s *VolumeService) GetUploadParamsForVolume(p *GetUploadParamsForVolumeParams) (*GetUploadParamsForVolumeResponse, error) { + resp, err := s.cs.newRequest("getUploadParamsForVolume", p.toURLValues()) + if err != nil { + return nil, err + } + + var r GetUploadParamsForVolumeResponse + if err := json.Unmarshal(resp, &r); err != nil { + return nil, err + } + return &r, nil +} + +type GetUploadParamsForVolumeResponse struct { + Expires string `json:"expires,omitempty"` + Id string `json:"id,omitempty"` + Metadata string `json:"metadata,omitempty"` + PostURL string `json:"postURL,omitempty"` + Signature string `json:"signature,omitempty"` +} diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ZoneService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ZoneService.go index 56894dbdf..68fa7b211 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/ZoneService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/ZoneService.go @@ -263,7 +263,6 @@ type CreateZoneResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` - Vlan string `json:"vlan,omitempty"` Zonetoken string `json:"zonetoken,omitempty"` } @@ -531,7 +530,6 @@ type UpdateZoneResponse struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` - Vlan string `json:"vlan,omitempty"` Zonetoken string `json:"zonetoken,omitempty"` } @@ -860,7 +858,6 @@ type Zone struct { Resourcetype string `json:"resourcetype,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` - Vlan string `json:"vlan,omitempty"` Zonetoken string `json:"zonetoken,omitempty"` } diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go index 20eb3a798..8c357cb49 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go @@ -59,9 +59,9 @@ type CloudStackClient struct { AffinityGroup *AffinityGroupService Alert *AlertService Asyncjob *AsyncjobService + Authentication *AuthenticationService AutoScale *AutoScaleService Baremetal *BaremetalService - BigSwitchVNS *BigSwitchVNSService Certificate *CertificateService CloudIdentifier *CloudIdentifierService Cluster *ClusterService @@ -91,11 +91,11 @@ type CloudStackClient struct { Pool *PoolService PortableIP *PortableIPService Project *ProjectService + Quota *QuotaService Region *RegionService Resourcemetadata *ResourcemetadataService Resourcetags *ResourcetagsService Router *RouterService - S3 *S3Service SSH *SSHService SecurityGroup *SecurityGroupService ServiceOffering *ServiceOfferingService @@ -140,9 +140,9 @@ func newClient(apiurl string, apikey string, secret string, async bool, verifyss cs.AffinityGroup = NewAffinityGroupService(cs) cs.Alert = NewAlertService(cs) cs.Asyncjob = NewAsyncjobService(cs) + cs.Authentication = NewAuthenticationService(cs) cs.AutoScale = NewAutoScaleService(cs) cs.Baremetal = NewBaremetalService(cs) - cs.BigSwitchVNS = NewBigSwitchVNSService(cs) cs.Certificate = NewCertificateService(cs) cs.CloudIdentifier = NewCloudIdentifierService(cs) cs.Cluster = NewClusterService(cs) @@ -172,11 +172,11 @@ func newClient(apiurl string, apikey string, secret string, async bool, verifyss cs.Pool = NewPoolService(cs) cs.PortableIP = NewPortableIPService(cs) cs.Project = NewProjectService(cs) + cs.Quota = NewQuotaService(cs) cs.Region = NewRegionService(cs) cs.Resourcemetadata = NewResourcemetadataService(cs) cs.Resourcetags = NewResourcetagsService(cs) cs.Router = NewRouterService(cs) - cs.S3 = NewS3Service(cs) cs.SSH = NewSSHService(cs) cs.SecurityGroup = NewSecurityGroupService(cs) cs.ServiceOffering = NewServiceOfferingService(cs) @@ -417,6 +417,14 @@ func NewAsyncjobService(cs *CloudStackClient) *AsyncjobService { return &AsyncjobService{cs: cs} } +type AuthenticationService struct { + cs *CloudStackClient +} + +func NewAuthenticationService(cs *CloudStackClient) *AuthenticationService { + return &AuthenticationService{cs: cs} +} + type AutoScaleService struct { cs *CloudStackClient } @@ -433,14 +441,6 @@ func NewBaremetalService(cs *CloudStackClient) *BaremetalService { return &BaremetalService{cs: cs} } -type BigSwitchVNSService struct { - cs *CloudStackClient -} - -func NewBigSwitchVNSService(cs *CloudStackClient) *BigSwitchVNSService { - return &BigSwitchVNSService{cs: cs} -} - type CertificateService struct { cs *CloudStackClient } @@ -673,6 +673,14 @@ func NewProjectService(cs *CloudStackClient) *ProjectService { return &ProjectService{cs: cs} } +type QuotaService struct { + cs *CloudStackClient +} + +func NewQuotaService(cs *CloudStackClient) *QuotaService { + return &QuotaService{cs: cs} +} + type RegionService struct { cs *CloudStackClient } @@ -705,14 +713,6 @@ func NewRouterService(cs *CloudStackClient) *RouterService { return &RouterService{cs: cs} } -type S3Service struct { - cs *CloudStackClient -} - -func NewS3Service(cs *CloudStackClient) *S3Service { - return &S3Service{cs: cs} -} - type SSHService struct { cs *CloudStackClient }