Documentation ¶
Index ¶
- Variables
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type AggregationResetBody
- type ComputerSystem
- type ComputerSystemCollection
- type DefaultApiController
- func (c *DefaultApiController) AggregationServiceActionsAggregationServiceResetPost(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) ComputerSystemsGet(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) ComputerSystemsNameActionsComputerSystemResetPost(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) ComputerSystemsNameGet(w http.ResponseWriter, r *http.Request)
- func (c *DefaultApiController) Routes() Routes
- type DefaultApiRouter
- type DefaultApiService
- func (s *DefaultApiService) AggregationServiceActionsAggregationServiceResetPost(ctx context.Context, aggregationResetBody AggregationResetBody) (ImplResponse, error)
- func (s *DefaultApiService) ComputerSystemsGet(ctx context.Context) (ImplResponse, error)
- func (s *DefaultApiService) ComputerSystemsNameActionsComputerSystemResetPost(ctx context.Context, name string, resetRequestBody ResetRequestBody) (ImplResponse, error)
- func (s *DefaultApiService) ComputerSystemsNameGet(ctx context.Context, name string) (ImplResponse, error)
- type DefaultApiServicer
- type Error
- type ErrorError
- type ImplResponse
- type PowerState
- type PowermanApiService
- func (s *PowermanApiService) AggregationServiceActionsAggregationServiceResetPost(ctx context.Context, aggregationResetBody AggregationResetBody) (ImplResponse, error)
- func (s *PowermanApiService) ComputerSystemsGet(ctx context.Context) (ImplResponse, error)
- func (s *PowermanApiService) ComputerSystemsNameActionsComputerSystemResetPost(ctx context.Context, name string, resetRequestBody ResetRequestBody) (ImplResponse, error)
- func (s *PowermanApiService) ComputerSystemsNameGet(ctx context.Context, name string) (ImplResponse, error)
- type ResetRequestBody
- type ResetType
- type Route
- type Router
- type Routes
Constants ¶
This section is empty.
Variables ¶
var ERROR_NOTSUPPORTED = errors.New("operation not supported")
Functions ¶
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type AggregationResetBody ¶
type AggregationResetBody struct { ResetType ResetType `json:"ResetType,omitempty"` // A list of system URIs to apply the reset to TargetURIs []string `json:"TargetURIs,omitempty"` }
AggregationResetBody - Aggregation reset request
type ComputerSystem ¶
type ComputerSystem struct { // An id is a URI-reference for the object Id string `json:"id"` // The name is the unique name identifier for the ComputerSystem. This is used to reference the system in the API. Name string `json:"name"` PowerState PowerState `json:"powerState,omitempty"` }
ComputerSystem - A single computer system with power state
type ComputerSystemCollection ¶
type ComputerSystemCollection struct { // An id is a URI-reference for the object Id string `json:"id,omitempty"` // Human-readable name for the collection Name string `json:"name,omitempty"` // Collection of ComputerSystem objects Systems []ComputerSystem `json:"systems,omitempty"` }
ComputerSystemCollection - A collection of computer systems
type DefaultApiController ¶
type DefaultApiController struct {
// contains filtered or unexported fields
}
A DefaultApiController binds http requests to an api service and writes the service results to the http response
func (*DefaultApiController) AggregationServiceActionsAggregationServiceResetPost ¶
func (c *DefaultApiController) AggregationServiceActionsAggregationServiceResetPost(w http.ResponseWriter, r *http.Request)
AggregationServiceActionsAggregationServiceResetPost - Request aggregate system reset
func (*DefaultApiController) ComputerSystemsGet ¶
func (c *DefaultApiController) ComputerSystemsGet(w http.ResponseWriter, r *http.Request)
ComputerSystemsGet - Get computer systems
func (*DefaultApiController) ComputerSystemsNameActionsComputerSystemResetPost ¶
func (c *DefaultApiController) ComputerSystemsNameActionsComputerSystemResetPost(w http.ResponseWriter, r *http.Request)
ComputerSystemsNameActionsComputerSystemResetPost - Request system reset
func (*DefaultApiController) ComputerSystemsNameGet ¶
func (c *DefaultApiController) ComputerSystemsNameGet(w http.ResponseWriter, r *http.Request)
ComputerSystemsNameGet - Get a specific computer system state
func (*DefaultApiController) Routes ¶
func (c *DefaultApiController) Routes() Routes
Routes returns all of the api route for the DefaultApiController
type DefaultApiRouter ¶
type DefaultApiRouter interface { AggregationServiceActionsAggregationServiceResetPost(http.ResponseWriter, *http.Request) ComputerSystemsGet(http.ResponseWriter, *http.Request) ComputerSystemsNameActionsComputerSystemResetPost(http.ResponseWriter, *http.Request) ComputerSystemsNameGet(http.ResponseWriter, *http.Request) }
DefaultApiRouter defines the required methods for binding the api requests to a responses for the DefaultApi The DefaultApiRouter implementation should parse necessary information from the http request, pass the data to a DefaultApiServicer to perform the required actions, then write the service results to the http response.
type DefaultApiService ¶
type DefaultApiService struct { }
DefaultApiService is a service that implents the logic for the DefaultApiServicer This service should implement the business logic for every endpoint for the DefaultApi API. Include any external packages or services that will be required by this service.
func (*DefaultApiService) AggregationServiceActionsAggregationServiceResetPost ¶
func (s *DefaultApiService) AggregationServiceActionsAggregationServiceResetPost(ctx context.Context, aggregationResetBody AggregationResetBody) (ImplResponse, error)
AggregationServiceActionsAggregationServiceResetPost - Request aggregate system reset
func (*DefaultApiService) ComputerSystemsGet ¶
func (s *DefaultApiService) ComputerSystemsGet(ctx context.Context) (ImplResponse, error)
ComputerSystemsGet - Get computer systems
func (*DefaultApiService) ComputerSystemsNameActionsComputerSystemResetPost ¶
func (s *DefaultApiService) ComputerSystemsNameActionsComputerSystemResetPost(ctx context.Context, name string, resetRequestBody ResetRequestBody) (ImplResponse, error)
ComputerSystemsNameActionsComputerSystemResetPost - Request system reset
func (*DefaultApiService) ComputerSystemsNameGet ¶
func (s *DefaultApiService) ComputerSystemsNameGet(ctx context.Context, name string) (ImplResponse, error)
ComputerSystemsNameGet - Get a specific computer system state
type DefaultApiServicer ¶
type DefaultApiServicer interface { AggregationServiceActionsAggregationServiceResetPost(context.Context, AggregationResetBody) (ImplResponse, error) ComputerSystemsGet(context.Context) (ImplResponse, error) ComputerSystemsNameActionsComputerSystemResetPost(context.Context, string, ResetRequestBody) (ImplResponse, error) ComputerSystemsNameGet(context.Context, string) (ImplResponse, error) }
DefaultApiServicer defines the api actions for the DefaultApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewDefaultApiService ¶
func NewDefaultApiService() DefaultApiServicer
NewDefaultApiService creates a default api service
func NewPowermanApiService ¶
func NewPowermanApiService(server string, port int) DefaultApiServicer
NewPowermanApiService creates a default api service
type Error ¶
type Error struct {
Error ErrorError `json:"error,omitempty"`
}
type ErrorError ¶
type ErrorError struct { // Response code Code string `json:"code"` // A human-readable error message string Message string `json:"message"` }
ErrorError - Properties that describe the error
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
Implementation response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type PowerState ¶
type PowerState string
PowerState : Power state for a component
const ( POWERSTATE_ON PowerState = "On" POWERSTATE_OFF PowerState = "Off" )
List of PowerState
type PowermanApiService ¶
type PowermanApiService struct {
// contains filtered or unexported fields
}
PowermanApiService is a service that implents the logic for the DefaultApiServicer
func (*PowermanApiService) AggregationServiceActionsAggregationServiceResetPost ¶
func (s *PowermanApiService) AggregationServiceActionsAggregationServiceResetPost(ctx context.Context, aggregationResetBody AggregationResetBody) (ImplResponse, error)
AggregationServiceActionsAggregationServiceResetPost - Request aggregate system reset
func (*PowermanApiService) ComputerSystemsGet ¶
func (s *PowermanApiService) ComputerSystemsGet(ctx context.Context) (ImplResponse, error)
ComputerSystemsGet - Get computer systems
func (*PowermanApiService) ComputerSystemsNameActionsComputerSystemResetPost ¶
func (s *PowermanApiService) ComputerSystemsNameActionsComputerSystemResetPost(ctx context.Context, name string, resetRequestBody ResetRequestBody) (ImplResponse, error)
ComputerSystemsNameActionsComputerSystemResetPost - Request system reset
func (*PowermanApiService) ComputerSystemsNameGet ¶
func (s *PowermanApiService) ComputerSystemsNameGet(ctx context.Context, name string) (ImplResponse, error)
ComputerSystemsNameGet - Get a specific computer system state
type ResetRequestBody ¶
type ResetRequestBody struct {
ResetType ResetType `json:"ResetType"`
}
ResetRequestBody - Reset request
type ResetType ¶
type ResetType string
const ( RESETTYPE_ON ResetType = "On" RESETTYPE_FORCE_OFF ResetType = "ForceOff" RESETTYPE_GRACEFUL_SHUTDOWN ResetType = "GracefulShutdown" RESETTYPE_GRACEFUL_RESTART ResetType = "GracefulRestart" RESETTYPE_FORCE_RESTART ResetType = "ForceRestart" RESETTYPE_NMI ResetType = "Nmi" RESETTYPE_FORCE_ON ResetType = "ForceOn" RESETTYPE_PUSH_POWER_BUTTON ResetType = "PushPowerButton" RESETTYPE_POWER_CYCLE ResetType = "PowerCycle" )
List of ResetType
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewDefaultApiController ¶
func NewDefaultApiController(s DefaultApiServicer) Router
NewDefaultApiController creates a default api controller
Source Files ¶
- api.go
- api_default.go
- api_default_service.go
- api_powerman_service.go
- helpers.go
- impl.go
- logger.go
- model_aggregation_reset_body.go
- model_computer_system.go
- model_computer_system_collection.go
- model_error.go
- model_error_error.go
- model_power_state.go
- model_reset_request_body.go
- model_reset_type.go
- routers.go