blob: de1f7c8d47717d88fd0ebcb71066428cf5c0d1f7 [file] [log] [blame]
Samuel A. Falvo II2e2b8772013-07-04 15:40:15 -07001package gophercloud
2
3// AccessProvider instances encapsulate a Keystone authentication interface.
4type AccessProvider interface {
5 // FirstEndpointUrlByCriteria searches through the service catalog for the first
6 // matching entry endpoint fulfilling the provided criteria. If nothing found,
7 // return "". Otherwise, return either the public or internal URL for the
8 // endpoint, depending on both its existence and the setting of the ApiCriteria.UrlChoice
9 // field.
10 FirstEndpointUrlByCriteria(ApiCriteria) string
Samuel A. Falvo IIbc0d54a2013-07-08 14:45:21 -070011
Samuel A. Falvo IIbc0d54a2013-07-08 14:45:21 -070012 // AuthToken provides a copy of the current authentication token for the user's credentials.
Samuel A. Falvo II659e14b2013-07-16 12:04:54 -070013 // Note that AuthToken() will not automatically refresh an expired token.
Samuel A. Falvo IIbc0d54a2013-07-08 14:45:21 -070014 AuthToken() string
Samuel A. Falvo II659e14b2013-07-16 12:04:54 -070015
16 // Revoke allows you to terminate any program's access to the OpenStack API by token ID.
17 Revoke(string) error
Samuel A. Falvo II9e64f6b2013-07-16 14:26:50 -070018
19 // Reauthenticate attempts to acquire a new authentication token, if the feature is enabled by
20 // AuthOptions.AllowReauth.
21 Reauthenticate() error
Samuel A. Falvo II2e2b8772013-07-04 15:40:15 -070022}
23
Samuel A. Falvo II1dd740a2013-07-08 15:48:40 -070024// CloudServersProvider instances encapsulate a Cloud Servers API, should one exist in the service catalog
Samuel A. Falvo II2e2b8772013-07-04 15:40:15 -070025// for your provider.
Samuel A. Falvo II1dd740a2013-07-08 15:48:40 -070026type CloudServersProvider interface {
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070027 // Servers
28
Samuel A. Falvo II2e2b8772013-07-04 15:40:15 -070029 ListServers() ([]Server, error)
Samuel A. Falvo II5c305e12013-07-25 19:19:43 -070030 ListServersLinksOnly() ([]Server, error)
Samuel A. Falvo II02f5e832013-07-10 13:52:27 -070031 ServerById(id string) (*Server, error)
Samuel A. Falvo IIe91ff6d2013-07-11 15:46:10 -070032 CreateServer(ns NewServer) (*NewServer, error)
Samuel A. Falvo II286e4de2013-07-12 11:33:31 -070033 DeleteServerById(id string) error
Samuel A. Falvo II5c305e12013-07-25 19:19:43 -070034 SetAdminPassword(id string, pw string) error
Samuel A. Falvo II8512e9a2013-07-26 22:53:29 -070035 ResizeServer(id, newName, newFlavor, newDiskConfig string) error
36 RevertResize(id string) error
37 ConfirmResize(id string) error
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070038
39 // Images
40
41 ListImages() ([]Image, error)
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070042
43 // Flavors
44
45 ListFlavors() ([]Flavor, error)
Samuel A. Falvo II2e2b8772013-07-04 15:40:15 -070046}
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070047