Documentation ¶
Index ¶
- type Nova
- func (n *Nova) AddNeutronModel(neutronModel *neutronmodel.NeutronModel)
- func (n *Nova) AddOSInterface(serverID string, osInterfaces ...nova.OSInterface) error
- func (n *Nova) Endpoints() []identityservice.Endpoint
- func (n *Nova) HandleRoot(w http.ResponseWriter, r *http.Request)
- func (n *Nova) RemoveOSInterface(serverID, ipAddress string) error
- func (n *Nova) SetAZForNoValidHosts(zone nova.AvailabilityZone)
- func (n *Nova) SetAvailabilityZones(zones ...nova.AvailabilityZone)
- func (n *Nova) SetServerStatus(status string)
- func (n *Nova) SetupHTTP(mux *http.ServeMux)
- func (n *Nova) SetupRootHandler(mux *http.ServeMux)
- func (n *Nova) Stop()
- func (n *Nova) V3Endpoints() []identityservice.V3Endpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Nova ¶
type Nova struct { testservices.ServiceInstance // contains filtered or unexported fields }
Nova implements a OpenStack Nova testing service and contains the service double's internal state.
func New ¶
func New(hostURL, versionPath, tenantId, region string, identityService, fallbackIdentity identityservice.IdentityService) *Nova
New creates an instance of the Nova object, given the parameters.
func (*Nova) AddNeutronModel ¶
func (n *Nova) AddNeutronModel(neutronModel *neutronmodel.NeutronModel)
AddNeutronModel setups up the test double to use Neutron networking which requires shared data between the nova and neutron test doubles.
func (*Nova) AddOSInterface ¶
func (n *Nova) AddOSInterface(serverID string, osInterfaces ...nova.OSInterface) error
AddOSInterface adds a os-interface attachment to a server.
func (*Nova) Endpoints ¶
func (n *Nova) Endpoints() []identityservice.Endpoint
func (*Nova) HandleRoot ¶
func (n *Nova) HandleRoot(w http.ResponseWriter, r *http.Request)
func (*Nova) RemoveOSInterface ¶
RemoveOSInterface removes a os-interface attachment from a server based on the matching criteria.
func (*Nova) SetAZForNoValidHosts ¶
func (n *Nova) SetAZForNoValidHosts(zone nova.AvailabilityZone)
SetAZForNoValidHosts sets an availability zone to cause a No valid host failures.
Note: this is implemented as a public method rather than as an HTTP API for the same reasons as SetAvailabilityZones, as well as defining an availability zone to cause 'No valid host' failures.
func (*Nova) SetAvailabilityZones ¶
func (n *Nova) SetAvailabilityZones(zones ...nova.AvailabilityZone)
SetAvailabilityZones sets the availability zones for setting availability zones.
Note: this is implemented as a public method rather than as an HTTP API for two reasons: availability zones are created indirectly via "host aggregates", which are a cloud-provider concept that we have not implemented, and because we want to be able to synthesize zone state changes.
func (*Nova) SetServerStatus ¶
SetServerStatus sets the ServerDetail.Status to a new value.
Note: this is implemented as a public method rather than as an HTTP API to allow for changing the status inside of the returned data structure, not accomplished by the testservice hooks
func (*Nova) SetupHTTP ¶
SetupHTTP attaches all the needed handlers to provide the HTTP API.
TODO (stickupkid): The following needs re-working for version 3 of goose. Instead we should be providing a router matching library. There is way too much ad-hock calling of methods in different call sites, that makes it almost impossible to follow the flow of this stub.
Instead we should define our routes up front as a dependency of our tests.
Example of this would be:
handlers := map[string]http.Handler{ "/{version}/{tenant_id}/servers/{server_id}/os-interfaces": n.handleOSInterfaces, }
func (*Nova) SetupRootHandler ¶
func (*Nova) V3Endpoints ¶
func (n *Nova) V3Endpoints() []identityservice.V3Endpoint