Documentation
¶
Index ¶
- Variables
- func AddToAggregate(ctx context.Context, serviceClient *gophercloud.ServiceClient, ...) (err error)
- func CleanupResourceProvider(ctx context.Context, client *gophercloud.ServiceClient, ...) error
- func GetAggregatesByName(ctx context.Context, serviceClient *gophercloud.ServiceClient) (map[string]*aggregates.Aggregate, error)
- func GetHypervisorByName(ctx context.Context, sc *gophercloud.ServiceClient, ...) (*hypervisors.Hypervisor, error)
- func GetServiceClient(ctx context.Context, serviceType string, authInfo *clientconfig.AuthInfo) (*gophercloud.ServiceClient, error)
- func RemoveFromAggregate(ctx context.Context, serviceClient *gophercloud.ServiceClient, ...) error
- type ConsumerAllocations
- type HyperVisorsDetails
- type ListAllocationsResult
- type UpdateServiceOpts
- type UpdateTraitsOpts
- type UpdateTraitsOptsBuilder
- type UpdateTraitsResult
Constants ¶
This section is empty.
Variables ¶
var ErrMultipleHypervisors = errors.New("multiple hypervisors found")
var ErrNoHypervisor = errors.New("no hypervisor found")
Functions ¶
func AddToAggregate ¶
func AddToAggregate(ctx context.Context, serviceClient *gophercloud.ServiceClient, aggs map[string]*aggregates.Aggregate, host, name, zone string) (err error)
AddToAggregate adds the given host to the named aggregate, creating the aggregate if it does not yet exist.
func CleanupResourceProvider ¶
func CleanupResourceProvider(ctx context.Context, client *gophercloud.ServiceClient, provider *resourceproviders.ResourceProvider) error
Remove all empty Allocations for a certain provider, and if it is empty, delete it
func GetAggregatesByName ¶
func GetAggregatesByName(ctx context.Context, serviceClient *gophercloud.ServiceClient) (map[string]*aggregates.Aggregate, error)
GetAggregatesByName retrieves all aggregates from nova and returns them as a map keyed by name.
func GetHypervisorByName ¶
func GetHypervisorByName(ctx context.Context, sc *gophercloud.ServiceClient, hypervisorHostnamePattern string, withServers bool) (*hypervisors.Hypervisor, error)
func GetServiceClient ¶
func GetServiceClient(ctx context.Context, serviceType string, authInfo *clientconfig.AuthInfo) (*gophercloud.ServiceClient, error)
GetServiceClient returns an gophercloud ServiceClient for the given serviceType.
func RemoveFromAggregate ¶
func RemoveFromAggregate(ctx context.Context, serviceClient *gophercloud.ServiceClient, aggs map[string]*aggregates.Aggregate, host, name string) error
RemoveFromAggregate removes the given host from the named aggregate.
Types ¶
type ConsumerAllocations ¶
type ConsumerAllocations struct {
Allocations map[string]resourceproviders.Allocation `json:"allocations"`
ConsumerGeneration int `json:"consumer_generation"`
ProjectID string `json:"project_id"`
UserID string `json:"user_id"`
ConsumerType string `json:"consumer_type"`
}
type HyperVisorsDetails ¶
type HyperVisorsDetails struct {
Hypervisors []hypervisors.Hypervisor `json:"hypervisors"`
}
type ListAllocationsResult ¶
type ListAllocationsResult struct {
gophercloud.Result
}
ListAllocationsResult is the response of a Get allocations operations. Call its Extract method to interpret it as a Allocations.
func DeleteConsumerAllocations ¶
func DeleteConsumerAllocations(ctx context.Context, client *gophercloud.ServiceClient, consumerID string) (r ListAllocationsResult)
Delete all Allocations for a certain consumer
func ListAllocations ¶
func ListAllocations(ctx context.Context, client *gophercloud.ServiceClient, consumerID string) (r ListAllocationsResult)
List Allocations for a certain consumer
func (ListAllocationsResult) Extract ¶
func (r ListAllocationsResult) Extract() (*ConsumerAllocations, error)
Extract interprets a ListAllocationsResult as a Allocations.
type UpdateServiceOpts ¶
type UpdateServiceOpts struct {
// Status represents the new service status. One of enabled or disabled.
Status services.ServiceStatus `json:"status,omitempty"`
// DisabledReason represents the reason for disabling a service.
DisabledReason string `json:"disabled_reason,omitempty"`
// ForcedDown is a manual override to tell nova that the service in question
// has been fenced manually by the operations team.
ForcedDown *bool `json:"forced_down,omitempty"`
}
func (UpdateServiceOpts) ToServiceUpdateMap ¶
func (opts UpdateServiceOpts) ToServiceUpdateMap() (map[string]any, error)
ToServiceUpdateMap formats an UpdateServiceOpts structure into a request body.
type UpdateTraitsOpts ¶
type UpdateTraitsOpts struct {
Traits []string `json:"traits"`
ResourceProviderGeneration int `json:"resource_provider_generation"`
}
UpdateTraitsOpts represents options used to create a resource provider.
func (UpdateTraitsOpts) ToResourceProviderUpdateTraitsMap ¶
func (opts UpdateTraitsOpts) ToResourceProviderUpdateTraitsMap() (map[string]any, error)
ToResourceProviderUpdateTraitsMap constructs a request body from UpdateTraitsOpts.
type UpdateTraitsOptsBuilder ¶
type UpdateTraitsOptsBuilder interface {
ToResourceProviderUpdateTraitsMap() (map[string]any, error)
}
UpdateTraitsOptsBuilder allows extensions to add additional parameters to the UpdateTraits request.
type UpdateTraitsResult ¶
type UpdateTraitsResult struct {
gophercloud.Result
}
UpdateTraitsResult is the response of a Put traits operations. Call its Extract method to interpret it as a ResourceProviderTraits.
func UpdateTraits ¶
func UpdateTraits(ctx context.Context, client *gophercloud.ServiceClient, resourceProviderID string, opts UpdateTraitsOptsBuilder) (r UpdateTraitsResult)