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 (30 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (5)
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
/*
Package volumeattach provides the ability to attach and detach volumes
from servers.

Example to Attach a Volume

	serverID := "7ac8686c-de71-4acb-9600-ec18b1a1ed6d"
	volumeID := "87463836-f0e2-4029-abf6-20c8892a3103"

	createOpts := volumeattach.CreateOpts{
		Device:   "/dev/vdc",
		VolumeID: volumeID,
	}

	result, err := volumeattach.Create(computeClient, serverID, createOpts).Extract()
	if err != nil {
		panic(err)
	}

Example to Detach a Volume

	serverID := "7ac8686c-de71-4acb-9600-ec18b1a1ed6d"
	attachmentID := "ed081613-1c9b-4231-aa5e-ebfd4d87f983"

	err := volumeattach.Delete(computeClient, serverID, attachmentID).ExtractErr()
	if err != nil {
		panic(err)
	}
*/
package volumeattach