doc.go raw
1 /*
2 Package clientconfig provides convienent functions for creating OpenStack
3 clients. It is based on the Python os-client-config library.
4
5 See https://docs.openstack.org/os-client-config/latest for details.
6
7 Example to Create a Provider Client From clouds.yaml
8
9 opts := &clientconfig.ClientOpts{
10 Cloud: "hawaii",
11 }
12
13 pClient, err := clientconfig.AuthenticatedClient(opts)
14 if err != nil {
15 panic(err)
16 }
17
18 Example to Manually Create a Provider Client
19
20 opts := &clientconfig.ClientOpts{
21 AuthInfo: &clientconfig.AuthInfo{
22 AuthURL: "https://hi.example.com:5000/v3",
23 Username: "jdoe",
24 Password: "password",
25 ProjectName: "Some Project",
26 DomainName: "default",
27 },
28 }
29
30 pClient, err := clientconfig.AuthenticatedClient(opts)
31 if err != nil {
32 panic(err)
33 }
34
35 Example to Create a Service Client from clouds.yaml
36
37 opts := &clientconfig.ClientOpts{
38 Cloud: "hawaii",
39 }
40
41 computeClient, err := clientconfig.NewServiceClient("compute", opts)
42 if err != nil {
43 panic(err)
44 }
45 */
46 package clientconfig
47