@@ -34,6 +34,8 @@ type ConfigurationServiceIface interface {
34
34
NewListDeploymentPlannersParams () * ListDeploymentPlannersParams
35
35
UpdateConfiguration (p * UpdateConfigurationParams ) (* UpdateConfigurationResponse , error )
36
36
NewUpdateConfigurationParams (name string ) * UpdateConfigurationParams
37
+ ResetConfiguration (p * ResetConfigurationParams ) (* ResetConfigurationResponse , error )
38
+ NewResetConfigurationParams (name string ) * ResetConfigurationParams
37
39
}
38
40
39
41
type ListCapabilitiesParams struct {
@@ -649,3 +651,177 @@ type UpdateConfigurationResponse struct {
649
651
Scope string `json:"scope"`
650
652
Value string `json:"value"`
651
653
}
654
+
655
+ type ResetConfigurationParams struct {
656
+ p map [string ]interface {}
657
+ }
658
+
659
+ func (p * ResetConfigurationParams ) toURLValues () url.Values {
660
+ u := url.Values {}
661
+ if p .p == nil {
662
+ return u
663
+ }
664
+ if v , found := p .p ["accountid" ]; found {
665
+ u .Set ("accountid" , v .(string ))
666
+ }
667
+ if v , found := p .p ["clusterid" ]; found {
668
+ u .Set ("clusterid" , v .(string ))
669
+ }
670
+ if v , found := p .p ["domainid" ]; found {
671
+ u .Set ("domainid" , v .(string ))
672
+ }
673
+ if v , found := p .p ["imagestoreid" ]; found {
674
+ u .Set ("imagestoreid" , v .(string ))
675
+ }
676
+ if v , found := p .p ["name" ]; found {
677
+ u .Set ("name" , v .(string ))
678
+ }
679
+ if v , found := p .p ["storageid" ]; found {
680
+ u .Set ("storageid" , v .(string ))
681
+ }
682
+ if v , found := p .p ["zoneid" ]; found {
683
+ u .Set ("zoneid" , v .(string ))
684
+ }
685
+ return u
686
+ }
687
+
688
+ func (p * ResetConfigurationParams ) SetAccountid (v string ) {
689
+ if p .p == nil {
690
+ p .p = make (map [string ]interface {})
691
+ }
692
+ p .p ["accountid" ] = v
693
+ }
694
+
695
+ func (p * ResetConfigurationParams ) GetAccountid () (string , bool ) {
696
+ if p .p == nil {
697
+ p .p = make (map [string ]interface {})
698
+ }
699
+ value , ok := p .p ["accountid" ].(string )
700
+ return value , ok
701
+ }
702
+
703
+ func (p * ResetConfigurationParams ) SetClusterid (v string ) {
704
+ if p .p == nil {
705
+ p .p = make (map [string ]interface {})
706
+ }
707
+ p .p ["clusterid" ] = v
708
+ }
709
+
710
+ func (p * ResetConfigurationParams ) GetClusterid () (string , bool ) {
711
+ if p .p == nil {
712
+ p .p = make (map [string ]interface {})
713
+ }
714
+ value , ok := p .p ["clusterid" ].(string )
715
+ return value , ok
716
+ }
717
+
718
+ func (p * ResetConfigurationParams ) SetDomainid (v string ) {
719
+ if p .p == nil {
720
+ p .p = make (map [string ]interface {})
721
+ }
722
+ p .p ["domainid" ] = v
723
+ }
724
+
725
+ func (p * ResetConfigurationParams ) GetDomainid () (string , bool ) {
726
+ if p .p == nil {
727
+ p .p = make (map [string ]interface {})
728
+ }
729
+ value , ok := p .p ["domainid" ].(string )
730
+ return value , ok
731
+ }
732
+
733
+ func (p * ResetConfigurationParams ) SetImagestoreid (v string ) {
734
+ if p .p == nil {
735
+ p .p = make (map [string ]interface {})
736
+ }
737
+ p .p ["imagestoreid" ] = v
738
+ }
739
+
740
+ func (p * ResetConfigurationParams ) GetImagestoreid () (string , bool ) {
741
+ if p .p == nil {
742
+ p .p = make (map [string ]interface {})
743
+ }
744
+ value , ok := p .p ["imagestoreid" ].(string )
745
+ return value , ok
746
+ }
747
+
748
+ func (p * ResetConfigurationParams ) SetName (v string ) {
749
+ if p .p == nil {
750
+ p .p = make (map [string ]interface {})
751
+ }
752
+ p .p ["name" ] = v
753
+ }
754
+
755
+ func (p * ResetConfigurationParams ) GetName () (string , bool ) {
756
+ if p .p == nil {
757
+ p .p = make (map [string ]interface {})
758
+ }
759
+ value , ok := p .p ["name" ].(string )
760
+ return value , ok
761
+ }
762
+
763
+ func (p * ResetConfigurationParams ) SetStorageid (v string ) {
764
+ if p .p == nil {
765
+ p .p = make (map [string ]interface {})
766
+ }
767
+ p .p ["storageid" ] = v
768
+ }
769
+
770
+ func (p * ResetConfigurationParams ) GetStorageid () (string , bool ) {
771
+ if p .p == nil {
772
+ p .p = make (map [string ]interface {})
773
+ }
774
+ value , ok := p .p ["storageid" ].(string )
775
+ return value , ok
776
+ }
777
+
778
+ func (p * ResetConfigurationParams ) SetZoneid (v string ) {
779
+ if p .p == nil {
780
+ p .p = make (map [string ]interface {})
781
+ }
782
+ p .p ["zoneid" ] = v
783
+ }
784
+
785
+ func (p * ResetConfigurationParams ) GetZoneid () (string , bool ) {
786
+ if p .p == nil {
787
+ p .p = make (map [string ]interface {})
788
+ }
789
+ value , ok := p .p ["zoneid" ].(string )
790
+ return value , ok
791
+ }
792
+
793
+ // You should always use this function to get a new ResetConfigurationParams instance,
794
+ // as then you are sure you have configured all required params
795
+ func (s * ConfigurationService ) NewResetConfigurationParams (name string ) * ResetConfigurationParams {
796
+ p := & ResetConfigurationParams {}
797
+ p .p = make (map [string ]interface {})
798
+ p .p ["name" ] = name
799
+ return p
800
+ }
801
+
802
+ // 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
803
+ func (s * ConfigurationService ) ResetConfiguration (p * ResetConfigurationParams ) (* ResetConfigurationResponse , error ) {
804
+ resp , err := s .cs .newRequest ("resetConfiguration" , p .toURLValues ())
805
+ if err != nil {
806
+ return nil , err
807
+ }
808
+
809
+ var r ResetConfigurationResponse
810
+ if err := json .Unmarshal (resp , & r ); err != nil {
811
+ return nil , err
812
+ }
813
+
814
+ return & r , nil
815
+ }
816
+
817
+ type ResetConfigurationResponse struct {
818
+ Category string `json:"category"`
819
+ Description string `json:"description"`
820
+ Id int64 `json:"id"`
821
+ Isdynamic bool `json:"isdynamic"`
822
+ JobID string `json:"jobid"`
823
+ Jobstatus int `json:"jobstatus"`
824
+ Name string `json:"name"`
825
+ Scope string `json:"scope"`
826
+ Value string `json:"value"`
827
+ }
0 commit comments