2018-02-12 17:10:05 +00:00
|
|
|
package egoscale
|
|
|
|
|
|
|
|
// API represents an API service
|
|
|
|
type API struct {
|
2018-09-14 08:06:03 +00:00
|
|
|
Description string `json:"description,omitempty" doc:"description of the api"`
|
2019-03-14 10:04:04 +00:00
|
|
|
IsAsync bool `json:"isasync" doc:"true if api is asynchronous"`
|
2018-09-14 08:06:03 +00:00
|
|
|
Name string `json:"name,omitempty" doc:"the name of the api command"`
|
|
|
|
Related string `json:"related,omitempty" doc:"comma separated related apis"`
|
|
|
|
Since string `json:"since,omitempty" doc:"version of CloudStack the api was introduced in"`
|
|
|
|
Type string `json:"type,omitempty" doc:"response field type"`
|
|
|
|
Params []APIParam `json:"params,omitempty" doc:"the list params the api accepts"`
|
|
|
|
Response []APIField `json:"response,omitempty" doc:"api response fields"`
|
2018-02-12 17:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// APIParam represents an API parameter field
|
|
|
|
type APIParam struct {
|
|
|
|
Description string `json:"description"`
|
|
|
|
Length int64 `json:"length"`
|
|
|
|
Name string `json:"name"`
|
2018-09-14 08:06:03 +00:00
|
|
|
Required bool `json:"required"`
|
|
|
|
Since string `json:"since,omitempty"`
|
2018-02-12 17:10:05 +00:00
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
|
|
|
|
2018-09-14 08:06:03 +00:00
|
|
|
// APIField represents an API response field
|
|
|
|
type APIField struct {
|
|
|
|
Description string `json:"description"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Response []APIField `json:"response,omitempty"`
|
|
|
|
Type string `json:"type"`
|
2018-02-12 17:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ListAPIs represents a query to list the api
|
|
|
|
type ListAPIs struct {
|
2018-09-14 08:06:03 +00:00
|
|
|
Name string `json:"name,omitempty" doc:"API name"`
|
|
|
|
_ bool `name:"listApis" description:"lists all available apis on the server"`
|
2018-02-12 17:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ListAPIsResponse represents a list of API
|
|
|
|
type ListAPIsResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
API []API `json:"api"`
|
|
|
|
}
|
2018-09-14 08:06:03 +00:00
|
|
|
|
2019-03-14 10:04:04 +00:00
|
|
|
// Response returns the struct to unmarshal
|
|
|
|
func (*ListAPIs) Response() interface{} {
|
2018-09-14 08:06:03 +00:00
|
|
|
return new(ListAPIsResponse)
|
|
|
|
}
|