File: doc.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 0.0~git20180917.45f1c769-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,768 kB
  • sloc: sh: 98; makefile: 14
file content (46 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Package diskconfig provides information and interaction with the Disk Config
extension that works with the OpenStack Compute service.

Example of Obtaining the Disk Config of a Server

	type ServerWithDiskConfig {
		servers.Server
		diskconfig.ServerDiskConfigExt
	}

	var allServers []ServerWithDiskConfig

	allPages, err := servers.List(client, nil).AllPages()
	if err != nil {
		panic("Unable to retrieve servers: %s", err)
	}

	err = servers.ExtractServersInto(allPages, &allServers)
	if err != nil {
		panic("Unable to extract servers: %s", err)
	}

	for _, server := range allServers {
		fmt.Println(server.DiskConfig)
	}

Example of Creating a Server with Disk Config

	serverCreateOpts := servers.CreateOpts{
		Name:      "server_name",
		ImageRef:  "image-uuid",
		FlavorRef: "flavor-uuid",
	}

	createOpts := diskconfig.CreateOptsExt{
		CreateOptsBuilder: serverCreateOpts,
		DiskConfig:        diskconfig.Manual,
	}

	server, err := servers.Create(computeClient, createOpts).Extract()
	if err != nil {
		panic("Unable to create server: %s", err)
	}
*/
package diskconfig