// PredictStorageAvailability returns the predicted available storage after
// a given period for the thin pool data device, the thin pool metadata device,
// and each tenant filesystem.
517490
func (f *Facade) PredictStorageAvailability(ctx datastore.Context, lookahead time.Duration) (map[string]float64, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.PredictStorageAvailability"))
	options := config.GetOptions()

	// First, get a list of all tenant IDs
	tenantIDs, err := f.ListTenants(ctx)
	if err != nil {
		return nil, err
	}

	// Next, query metrics for our window
	window := time.Duration(options.StorageMetricMonitorWindow) * time.Second
	perfdata, err := f.metricsClient.GetAvailableStorage(window, "mimmax", tenantIDs...)
	if err != nil {
		return nil, err
	}
	result := make(map[string]float64)
	predict := func(series metrics.MetricSeries) (float64, error) {
		return statistics.LeastSquaresPredictor.Predict(lookahead, series.X(), series.Y())
	}
	if avail, err := predict(perfdata.PoolDataAvailable); err == nil {
		result[metrics.PoolDataAvailableName] = avail
	}
	if avail, err := predict(perfdata.PoolMetadataAvailable); err == nil {
		result[metrics.PoolMetadataAvailableName] = avail
	}
	for tenant, series := range perfdata.Tenants {
		if avail, err := predict(series); err == nil {
			result[tenant] = avail
		}
	}
	return result, nil
}
1028771
func (t *Track) Availability() TrackAvailability {
	avail := C.sp_track_get_availability(
		t.session.sp_session,
		t.sp_track,
	)
	return TrackAvailability(avail)
}
425028
func (i *info) MarkAvailable() {
	i.m.Lock()
	ch := i.available
	i.available = nil
	close(ch)
	i.m.Unlock()
}
44013
func (s *RaidArray) SetAvailabilityZone(v string) *RaidArray {
	s.AvailabilityZone = &v
	return s
}
341627
func (s *PlacementType) SetAvailabilityZone(v string) *PlacementType {
	s.AvailabilityZone = &v
	return s
}
694756
func (c *guiCommand) checkAvailable(rawURL, newRawURL string, conn api.Connection) (string, error) {
	client, err := conn.HTTPClient()
	if err != nil {
		return "", errors.Annotate(err, "cannot retrieve HTTP client")
	}
	if err = clientGet(client, newRawURL); err == nil {
		return newRawURL, nil
	}
	if err = clientGet(client, rawURL); err != nil {
		return "", errors.Annotate(err, "Juju GUI is not available")
	}
	return rawURL, nil
}
1247315
func IsNotAvailable(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*notAvailable)
	return ok
}
766574
func (s *TargetDescription) SetAvailabilityZone(v string) *TargetDescription {
	s.AvailabilityZone = &v
	return s
}
206686
func (s *CreateDevEndpointOutput) SetAvailabilityZone(v string) *CreateDevEndpointOutput {
	s.AvailabilityZone = &v
	return s
}
262776
func (e *environ) DeriveAvailabilityZones(ctx context.ProviderCallContext, args environs.StartInstanceParams) ([]string, error) {
	availabilityZone, err := e.deriveAvailabilityZone(ctx, args)
	if availabilityZone != "" {
		return []string{availabilityZone}, errors.Trace(err)
	}
	return nil, errors.Trace(err)
}
1227086
func (s *DBInstanceAutomatedBackup) SetAvailabilityZone(v string) *DBInstanceAutomatedBackup {
	s.AvailabilityZone = &v
	return s
}
335884
func (s *CreateDiskInput) SetAvailabilityZone(v string) *CreateDiskInput {
	s.AvailabilityZone = &v
	return s
}
977092
func (c *MachineLearning) WaitUntilMLModelAvailable(input *DescribeMLModelsInput) error {
	return c.WaitUntilMLModelAvailableWithContext(aws.BackgroundContext(), input)
}
1308788
func (p *Pod) PodManifestAvailable() bool {
	if p.isPreparing || p.isAbortedPrepare || p.isDeleting {
		return false
	}
	return true
}
969178
func (s *InstanceEntry) SetAvailabilityZone(v string) *InstanceEntry {
	s.AvailabilityZone = &v
	return s
}
101280
func (e *Environ) InstanceAvailabilityZoneNames(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]string, error) {
	instances, err := e.Instances(ctx, ids)
	if err != nil && err != environs.ErrPartialInstances {
		providerCommon.HandleCredentialError(err, ctx)
		return nil, err
	}
	zones := []string{}
	for _, inst := range instances {
		oInst := inst.(*ociInstance)
		zones = append(zones, oInst.availabilityZone())
	}
	if len(zones) < len(ids) {
		return zones, environs.ErrPartialInstances
	}
	return zones, nil
}
1058770
func (s *Volume) SetAvailabilityZone(v string) *Volume {
	s.AvailabilityZone = &v
	return s
}