@@ -54,6 +54,64 @@ func dataSourceCloudstackNetworkOffering() *schema.Resource {
5454 Type : schema .TypeString ,
5555 Computed : true ,
5656 },
57+ "network_rate" : {
58+ Type : schema .TypeInt ,
59+ Computed : true ,
60+ },
61+ "network_mode" : {
62+ Type : schema .TypeString ,
63+ Computed : true ,
64+ },
65+ "conserve_mode" : {
66+ Type : schema .TypeBool ,
67+ Computed : true ,
68+ },
69+ "enable" : {
70+ Type : schema .TypeBool ,
71+ Computed : true ,
72+ },
73+ "for_vpc" : {
74+ Type : schema .TypeBool ,
75+ Computed : true ,
76+ },
77+ "for_nsx" : {
78+ Type : schema .TypeBool ,
79+ Computed : true ,
80+ },
81+ "specify_vlan" : {
82+ Type : schema .TypeBool ,
83+ Computed : true ,
84+ },
85+ "specify_ip_ranges" : {
86+ Type : schema .TypeBool ,
87+ Computed : true ,
88+ },
89+ "specify_as_number" : {
90+ Type : schema .TypeBool ,
91+ Computed : true ,
92+ },
93+ "internet_protocol" : {
94+ Type : schema .TypeString ,
95+ Computed : true ,
96+ },
97+ "routing_mode" : {
98+ Type : schema .TypeString ,
99+ Computed : true ,
100+ },
101+ "max_connections" : {
102+ Type : schema .TypeInt ,
103+ Computed : true ,
104+ },
105+ "supported_services" : {
106+ Type : schema .TypeSet ,
107+ Computed : true ,
108+ Elem : & schema.Schema {Type : schema .TypeString },
109+ },
110+ "service_provider_list" : {
111+ Type : schema .TypeMap ,
112+ Computed : true ,
113+ Elem : & schema.Schema {Type : schema .TypeString },
114+ },
57115 },
58116 }
59117}
@@ -100,6 +158,38 @@ func networkOfferingDescriptionAttributes(d *schema.ResourceData, networkOfferin
100158 d .Set ("display_text" , networkOffering .Displaytext )
101159 d .Set ("guest_ip_type" , networkOffering .Guestiptype )
102160 d .Set ("traffic_type" , networkOffering .Traffictype )
161+ d .Set ("network_rate" , networkOffering .Networkrate )
162+ d .Set ("network_mode" , networkOffering .Networkmode )
163+ d .Set ("conserve_mode" , networkOffering .Conservemode )
164+ d .Set ("enable" , networkOffering .State == "Enabled" )
165+ d .Set ("for_vpc" , networkOffering .Forvpc )
166+ d .Set ("for_nsx" , networkOffering .Fornsx )
167+ d .Set ("specify_vlan" , networkOffering .Specifyvlan )
168+ d .Set ("specify_ip_ranges" , networkOffering .Specifyipranges )
169+ d .Set ("specify_as_number" , networkOffering .Specifyasnumber )
170+ d .Set ("internet_protocol" , networkOffering .Internetprotocol )
171+ d .Set ("routing_mode" , networkOffering .Routingmode )
172+ d .Set ("max_connections" , networkOffering .Maxconnections )
173+
174+ // Set supported services
175+ if len (networkOffering .Service ) > 0 {
176+ services := make ([]string , len (networkOffering .Service ))
177+ for i , service := range networkOffering .Service {
178+ services [i ] = service .Name
179+ }
180+ d .Set ("supported_services" , services )
181+ }
182+
183+ // Set service provider list
184+ if len (networkOffering .Service ) > 0 {
185+ serviceProviders := make (map [string ]string )
186+ for _ , service := range networkOffering .Service {
187+ if len (service .Provider ) > 0 {
188+ serviceProviders [service .Name ] = service .Provider [0 ].Name
189+ }
190+ }
191+ d .Set ("service_provider_list" , serviceProviders )
192+ }
103193
104194 return nil
105195}
0 commit comments