Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cloudstack/AccountService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ func (p *ListAccountsParams) toURLValues() url.Values {
return u
}
if v, found := p.p["accounttype"]; found {
vv := strconv.FormatInt(v.(int64), 10)
vv := strconv.Itoa(v.(int))
u.Set("accounttype", vv)
}
if v, found := p.p["details"]; found {
Expand Down Expand Up @@ -1053,18 +1053,18 @@ func (p *ListAccountsParams) toURLValues() url.Values {
return u
}

func (p *ListAccountsParams) SetAccounttype(v int64) {
func (p *ListAccountsParams) SetAccounttype(v int) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["accounttype"] = v
}

func (p *ListAccountsParams) GetAccounttype() (int64, bool) {
func (p *ListAccountsParams) GetAccounttype() (int, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["accounttype"].(int64)
value, ok := p.p["accounttype"].(int)
return value, ok
}

Expand Down
90 changes: 90 additions & 0 deletions cloudstack/AddressService.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type AddressServiceIface interface {
GetPublicIpAddressByID(id string, opts ...OptionFunc) (*PublicIpAddress, int, error)
UpdateIpAddress(p *UpdateIpAddressParams) (*UpdateIpAddressResponse, error)
NewUpdateIpAddressParams(id string) *UpdateIpAddressParams
ReleaseIpAddress(p *ReleaseIpAddressParams) (*ReleaseIpAddressResponse, error)
NewReleaseIpAddressParams(id string) *ReleaseIpAddressParams
}

type AssociateIpAddressParams struct {
Expand Down Expand Up @@ -1096,3 +1098,91 @@ type UpdateIpAddressResponse struct {
Zoneid string `json:"zoneid"`
Zonename string `json:"zonename"`
}

type ReleaseIpAddressParams struct {
p map[string]interface{}
}

func (p *ReleaseIpAddressParams) 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 *ReleaseIpAddressParams) SetId(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["id"] = v
}

func (p *ReleaseIpAddressParams) GetId() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["id"].(string)
return value, ok
}

// You should always use this function to get a new ReleaseIpAddressParams instance,
// as then you are sure you have configured all required params
func (s *AddressService) NewReleaseIpAddressParams(id string) *ReleaseIpAddressParams {
p := &ReleaseIpAddressParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
}

// Releases an IP address from the account.
func (s *AddressService) ReleaseIpAddress(p *ReleaseIpAddressParams) (*ReleaseIpAddressResponse, error) {
resp, err := s.cs.newRequest("releaseIpAddress", p.toURLValues())
if err != nil {
return nil, err
}

var r ReleaseIpAddressResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}

return &r, nil
}

type ReleaseIpAddressResponse struct {
Displaytext string `json:"displaytext"`
JobID string `json:"jobid"`
Jobstatus int `json:"jobstatus"`
Success bool `json:"success"`
}

func (r *ReleaseIpAddressResponse) UnmarshalJSON(b []byte) error {
var m map[string]interface{}
err := json.Unmarshal(b, &m)
if err != nil {
return err
}

if success, ok := m["success"].(string); ok {
m["success"] = success == "true"
b, err = json.Marshal(m)
if err != nil {
return err
}
}

if ostypeid, ok := m["ostypeid"].(float64); ok {
m["ostypeid"] = strconv.Itoa(int(ostypeid))
b, err = json.Marshal(m)
if err != nil {
return err
}
}

type alias ReleaseIpAddressResponse
return json.Unmarshal(b, (*alias)(r))
}
29 changes: 29 additions & 0 deletions cloudstack/AddressService_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cloudstack/AffinityGroupService.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ type UpdateVMAffinityGroupResponse struct {
Isoname string `json:"isoname"`
JobID string `json:"jobid"`
Jobstatus int `json:"jobstatus"`
Keypair string `json:"keypair"`
Keypairs string `json:"keypairs"`
Lastupdated string `json:"lastupdated"`
Memory int `json:"memory"`
Memoryintfreekbs int64 `json:"memoryintfreekbs"`
Expand Down
6 changes: 6 additions & 0 deletions cloudstack/BrocadeVCSService.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ type BrocadeVcsDeviceNetwork struct {
Aclid string `json:"aclid"`
Aclname string `json:"aclname"`
Acltype string `json:"acltype"`
Associatednetwork string `json:"associatednetwork"`
Associatednetworkid string `json:"associatednetworkid"`
Broadcastdomaintype string `json:"broadcastdomaintype"`
Broadcasturi string `json:"broadcasturi"`
Canusefordeploy bool `json:"canusefordeploy"`
Expand All @@ -424,13 +426,17 @@ type BrocadeVcsDeviceNetwork struct {
Dns2 string `json:"dns2"`
Domain string `json:"domain"`
Domainid string `json:"domainid"`
Egressdefaultpolicy bool `json:"egressdefaultpolicy"`
Externalid string `json:"externalid"`
Gateway string `json:"gateway"`
Hasannotations bool `json:"hasannotations"`
Icon string `json:"icon"`
Id string `json:"id"`
Internetprotocol string `json:"internetprotocol"`
Ip6cidr string `json:"ip6cidr"`
Ip6gateway string `json:"ip6gateway"`
Ip6routes []interface{} `json:"ip6routes"`
Ip6routing string `json:"ip6routing"`
Isdefault bool `json:"isdefault"`
Ispersistent bool `json:"ispersistent"`
Issystem bool `json:"issystem"`
Expand Down
176 changes: 176 additions & 0 deletions cloudstack/ConfigurationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type ConfigurationServiceIface interface {
NewListDeploymentPlannersParams() *ListDeploymentPlannersParams
UpdateConfiguration(p *UpdateConfigurationParams) (*UpdateConfigurationResponse, error)
NewUpdateConfigurationParams(name string) *UpdateConfigurationParams
ResetConfiguration(p *ResetConfigurationParams) (*ResetConfigurationResponse, error)
NewResetConfigurationParams(name string) *ResetConfigurationParams
}

type ListCapabilitiesParams struct {
Expand Down Expand Up @@ -649,3 +651,177 @@ type UpdateConfigurationResponse struct {
Scope string `json:"scope"`
Value string `json:"value"`
}

type ResetConfigurationParams struct {
p map[string]interface{}
}

func (p *ResetConfigurationParams) 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["clusterid"]; found {
u.Set("clusterid", v.(string))
}
if v, found := p.p["domainid"]; found {
u.Set("domainid", v.(string))
}
if v, found := p.p["imagestoreid"]; found {
u.Set("imagestoreid", v.(string))
}
if v, found := p.p["name"]; found {
u.Set("name", v.(string))
}
if v, found := p.p["storageid"]; found {
u.Set("storageid", v.(string))
}
if v, found := p.p["zoneid"]; found {
u.Set("zoneid", v.(string))
}
return u
}

func (p *ResetConfigurationParams) SetAccountid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["accountid"] = v
}

func (p *ResetConfigurationParams) GetAccountid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["accountid"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetClusterid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["clusterid"] = v
}

func (p *ResetConfigurationParams) GetClusterid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["clusterid"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetDomainid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["domainid"] = v
}

func (p *ResetConfigurationParams) GetDomainid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["domainid"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetImagestoreid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["imagestoreid"] = v
}

func (p *ResetConfigurationParams) GetImagestoreid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["imagestoreid"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetName(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["name"] = v
}

func (p *ResetConfigurationParams) GetName() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["name"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetStorageid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["storageid"] = v
}

func (p *ResetConfigurationParams) GetStorageid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["storageid"].(string)
return value, ok
}

func (p *ResetConfigurationParams) SetZoneid(v string) {
if p.p == nil {
p.p = make(map[string]interface{})
}
p.p["zoneid"] = v
}

func (p *ResetConfigurationParams) GetZoneid() (string, bool) {
if p.p == nil {
p.p = make(map[string]interface{})
}
value, ok := p.p["zoneid"].(string)
return value, ok
}

// You should always use this function to get a new ResetConfigurationParams instance,
// as then you are sure you have configured all required params
func (s *ConfigurationService) NewResetConfigurationParams(name string) *ResetConfigurationParams {
p := &ResetConfigurationParams{}
p.p = make(map[string]interface{})
p.p["name"] = name
return p
}

// Resets a configuration. The configuration will be set to default value for global setting, and removed from account_details or domain_details for Account/Domain settings
func (s *ConfigurationService) ResetConfiguration(p *ResetConfigurationParams) (*ResetConfigurationResponse, error) {
resp, err := s.cs.newRequest("resetConfiguration", p.toURLValues())
if err != nil {
return nil, err
}

var r ResetConfigurationResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}

return &r, nil
}

type ResetConfigurationResponse struct {
Category string `json:"category"`
Description string `json:"description"`
Id int64 `json:"id"`
Isdynamic bool `json:"isdynamic"`
JobID string `json:"jobid"`
Jobstatus int `json:"jobstatus"`
Name string `json:"name"`
Scope string `json:"scope"`
Value string `json:"value"`
}
Loading