Documentation
¶
Index ¶
- Constants
- Variables
- func HostFromLogin(host string) string
- func RegisterCommands(registrar rsapi.ApiCommandRegistrar)
- type Api
- func (a *Api) BuildRequest(resource, action, href string, params rsapi.ApiParams) (*http.Request, error)
- func (a *Api) Dispatch(verb, uri string, params, payload rsapi.ApiParams) (*http.Response, error)
- func (a *Api) RunCommand(cmd string) (*http.Response, error)
- func (a *Api) ShowApiActions(cmd string) error
- func (a *Api) ShowCommandHelp(cmd string) error
Constants ¶
View Source
const (
// Used by rsc to display command line help
ApiName = "RightScale Self-Service APIs"
)
Variables ¶
View Source
var GenMetadata map[string]*metadata.Resource
Metadata synthetized from all SS APIs metadata
Functions ¶
func HostFromLogin ¶
Return Self-service endpoint from login endpoint The following isn't great but seems better than having to enter by hand
func RegisterCommands ¶
func RegisterCommands(registrar rsapi.ApiCommandRegistrar)
Register all commands with kinpin application
Types ¶
type Api ¶
Self-Service 1.0 common client to all self-service APIs
func FromCommandLine ¶
func FromCommandLine(cmdLine *cmd.CommandLine) (*Api, error)
Build client from command line
func (*Api) BuildRequest ¶
func (a *Api) BuildRequest(resource, action, href string, params rsapi.ApiParams) (*http.Request, error)
BuildRequest builds a HTTP request from a resource name and href and an action name and parameters. It is intended for generic clients that need to consume APIs in a generic maner. The method builds an HTTP request that can be fed to PerformRequest.
func (*Api) Dispatch ¶
Helper function that signs, makes and logs HTTP request. Used by generated client code.
func (*Api) RunCommand ¶
Parse and run command
Directories
¶
Path | Synopsis |
---|---|
Common dispatcher to all ss clients
|
Common dispatcher to all ss clients |
examples/basic
This basic example illustrates how to setup a Self-Service client to make a simple API call.
|
This basic example illustrates how to setup a Self-Service client to make a simple API call. |
Click to show internal directories.
Click to hide internal directories.