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,050 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Package tokens provides information and interaction with the token API
resource for the OpenStack Identity service.

For more information, see:
http://developer.openstack.org/api-ref-identity-v2.html#identity-auth-v2

Example to Create an Unscoped Token from a Password

	authOpts := gophercloud.AuthOptions{
		Username: "user",
		Password: "pass"
	}

	token, err := tokens.Create(identityClient, authOpts).ExtractToken()
	if err != nil {
		panic(err)
	}

Example to Create a Token from a Tenant ID and Password

	authOpts := gophercloud.AuthOptions{
		Username: "user",
		Password: "password",
		TenantID: "fc394f2ab2df4114bde39905f800dc57"
	}

	token, err := tokens.Create(identityClient, authOpts).ExtractToken()
	if err != nil {
		panic(err)
	}

Example to Create a Token from a Tenant Name and Password

	authOpts := gophercloud.AuthOptions{
		Username:   "user",
		Password:   "password",
		TenantName: "tenantname"
	}

	token, err := tokens.Create(identityClient, authOpts).ExtractToken()
	if err != nil {
		panic(err)
	}
*/
package tokens