MCPcopy Create free account
hub / github.com/apache/cloudstack-go / toURLValues

Method toURLValues

cloudstack/TemplateService.go:309–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307}
308
309func (p *CreateTemplateParams) toURLValues() url.Values {
310 u := url.Values{}
311 if p.p == nil {
312 return u
313 }
314 if v, found := p.p["account"]; found {
315 u.Set("account", v.(string))
316 }
317 if v, found := p.p["arch"]; found {
318 u.Set("arch", v.(string))
319 }
320 if v, found := p.p["bits"]; found {
321 vv := strconv.Itoa(v.(int))
322 u.Set("bits", vv)
323 }
324 if v, found := p.p["details"]; found {
325 m := v.(map[string]string)
326 for i, k := range getSortedKeysFromMap(m) {
327 u.Set(fmt.Sprintf("details[%d].%s", i, k), m[k])
328 }
329 }
330 if v, found := p.p["displaytext"]; found {
331 u.Set("displaytext", v.(string))
332 }
333 if v, found := p.p["domainid"]; found {
334 u.Set("domainid", v.(string))
335 }
336 if v, found := p.p["isdynamicallyscalable"]; found {
337 vv := strconv.FormatBool(v.(bool))
338 u.Set("isdynamicallyscalable", vv)
339 }
340 if v, found := p.p["isfeatured"]; found {
341 vv := strconv.FormatBool(v.(bool))
342 u.Set("isfeatured", vv)
343 }
344 if v, found := p.p["ispublic"]; found {
345 vv := strconv.FormatBool(v.(bool))
346 u.Set("ispublic", vv)
347 }
348 if v, found := p.p["name"]; found {
349 u.Set("name", v.(string))
350 }
351 if v, found := p.p["ostypeid"]; found {
352 u.Set("ostypeid", v.(string))
353 }
354 if v, found := p.p["passwordenabled"]; found {
355 vv := strconv.FormatBool(v.(bool))
356 u.Set("passwordenabled", vv)
357 }
358 if v, found := p.p["projectid"]; found {
359 u.Set("projectid", v.(string))
360 }
361 if v, found := p.p["requireshvm"]; found {
362 vv := strconv.FormatBool(v.(bool))
363 u.Set("requireshvm", vv)
364 }
365 if v, found := p.p["snapshotid"]; found {
366 u.Set("snapshotid", v.(string))

Callers

nothing calls this directly

Calls 1

getSortedKeysFromMapFunction · 0.85

Tested by

no test coverage detected