// ProvisioningInfo returns the provisioning info for the specified CAAS
// application in the current model.
166271
func (c *Client) ProvisioningInfo(appName string) (*ProvisioningInfo, error) {
	appTag, err := applicationTag(appName)
	if err != nil {
		return nil, errors.Trace(err)
	}
	args := entities(appTag)

	var results params.KubernetesProvisioningInfoResults
	if err := c.facade.FacadeCall("ProvisioningInfo", args, &results); err != nil {
		return nil, err
	}
	if n := len(results.Results); n != 1 {
		return nil, errors.Errorf("expected 1 result, got %d", n)
	}
	if err := results.Results[0].Error; err != nil {
		return nil, maybeNotFound(err)
	}
	result := results.Results[0].Result
	info := &ProvisioningInfo{
		PodSpec:     result.PodSpec,
		Constraints: result.Constraints,
		Tags:        result.Tags,
	}
	if result.DeploymentInfo != nil {
		info.DeploymentInfo = DeploymentInfo{
			DeploymentType: result.DeploymentInfo.DeploymentType,
			ServiceType:    result.DeploymentInfo.ServiceType,
		}
	}

	for _, fs := range result.Filesystems {
		fsInfo, err := filesystemFromParams(fs)
		if err != nil {
			return nil, errors.Trace(err)
		}
		info.Filesystems = append(info.Filesystems, *fsInfo)
	}

	var devs []devices.KubernetesDeviceParams
	for _, device := range result.Devices {
		devs = append(devs, devices.KubernetesDeviceParams{
			Type:       devices.DeviceType(device.Type),
			Count:      device.Count,
			Attributes: device.Attributes,
		})
	}
	info.Devices = devs
	return info, nil
}
1063051
func (s *DBCluster) SetScalingConfigurationInfo(v *ScalingConfigurationInfo) *DBCluster {
	s.ScalingConfigurationInfo = v
	return s
}
279408
func (c *fabricCAAdapter) GetCAInfo(caname string) (*api.GetCAInfoResponse, error) {
	logger.Debugf("Get CA info [%s]", caname)

	req := &caapi.GetCAInfoRequest{CAName: caname}
	resp, err := c.caClient.GetCAInfo(req)
	if err != nil {
		return nil, errors.WithMessage(err, "GetCAInfo failed")
	}

	return getCAInfoResponse(resp), nil
}
1209347
func (fw *Framework) ConfigureProvisioning() {
	fw.Config.Choria.FederationCollectives = []string{}
	fw.Config.Collectives = []string{"provisioning"}
	fw.Config.MainCollective = "provisioning"
	fw.Config.Registration = []string{}
	fw.Config.FactSourceFile = build.ProvisionFacts

	if build.ProvisionStatusFile != "" {
		fw.Config.Choria.StatusFilePath = build.ProvisionStatusFile
		fw.Config.Choria.StatusUpdateSeconds = 10
	}

	if build.ProvisionRegistrationData != "" {
		fw.Config.RegistrationCollective = "provisioning"
		fw.Config.Registration = []string{"file_content"}
		fw.Config.RegisterInterval = 120
		fw.Config.RegistrationSplay = false
		fw.Config.Choria.FileContentRegistrationTarget = "choria.provisioning_data"
		fw.Config.Choria.FileContentRegistrationData = build.ProvisionRegistrationData
	}

	if !build.ProvisionSecurity() {
		protocol.Secure = "false"
		fw.Config.Choria.SecurityProvider = "file"
		fw.Config.DisableTLS = true
	}
}
639877
func (api *OffersAPI) RemoteApplicationInfo(args params.OfferURLs) (params.RemoteApplicationInfoResults, error) {
	results := make([]params.RemoteApplicationInfoResult, len(args.OfferURLs))
	for i, url := range args.OfferURLs {
		info, err := api.oneRemoteApplicationInfo(url)
		results[i].Result = info
		results[i].Error = common.ServerError(err)
	}
	return params.RemoteApplicationInfoResults{results}, nil
}
94774
func (p *BuildrootProvisioner) Provision(swarmOptions swarm.Options, authOptions auth.Options, engineOptions engine.Options) error {
	p.SwarmOptions = swarmOptions
	p.AuthOptions = authOptions
	p.EngineOptions = engineOptions

	log.Debugf("setting hostname %q", p.Driver.GetMachineName())
	if err := p.SetHostname(p.Driver.GetMachineName()); err != nil {
		return err
	}

	p.AuthOptions = setRemoteAuthOptions(p)
	log.Debugf("set auth options %+v", p.AuthOptions)

	log.Debugf("setting up certificates")
	configureAuth := func() error {
		if err := configureAuth(p); err != nil {
			return &util.RetriableError{Err: err}
		}
		return nil
	}
	err := util.RetryAfter(5, configureAuth, time.Second*10)
	if err != nil {
		log.Debugf("Error configuring auth during provisioning %v", err)
		return err
	}

	log.Debugf("setting minikube options for container-runtime")
	if err := setMinikubeOptions(p); err != nil {
		log.Debugf("Error setting container-runtime options during provisioning %v", err)
		return err
	}

	return nil
}
102037
func (c *Client) ReleaseInfo(appIdentity string, releaseIdentity string) (*Release, error) {
	var release Release
	return &release, c.Get(&release, "/apps/"+appIdentity+"/releases/"+releaseIdentity)
}
1216369
func (s *Service) AddOnServiceInfo(ctx context.Context, addOnServiceIdentity string) (*AddOnService, error) {
	var addOnService AddOnService
	return &addOnService, s.Get(ctx, &addOnService, fmt.Sprintf("/addon-services/%v", addOnServiceIdentity), nil, nil)
}
405178
func (c *Client) AddonServiceInfo(addonServiceIdentity string) (*AddonService, error) {
	var addonService AddonService
	return &addonService, c.Get(&addonService, "/addon-services/"+addonServiceIdentity)
}
1210546
func (c *Client) GetApplicationInfo(id string) (appInfo AppInfo, err error) {
	if err := c.get(`server/get_app_info?SUBID=`+id, &appInfo); err != nil {
		return AppInfo{}, err
	}
	return appInfo, nil
}
141186
func (m *MockMachineProvisioner) ProvisioningInfo() (*params.ProvisioningInfo, error) {
	ret := m.ctrl.Call(m, "ProvisioningInfo")
	ret0, _ := ret[0].(*params.ProvisioningInfo)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
987761
func (a *azureObjects) StorageInfo(ctx context.Context) (si minio.StorageInfo) {
	return si
}
628527
func (c *Client) AccountInfo() (AccInfo, error) {
	data, err := c.apiCall("account.info", nil)
	if err != nil {
		return AccInfo{}, err
	}

	var info AccInfo
	err = json.Unmarshal(data, &info)
	if err != nil {
		return AccInfo{}, err
	}

	return info, nil
}
1338604
func (c *asyncClient) Info() (result FutureInfo, err Error) {
	var resp *PendingResponse
	resp, err = c.conn.QueueRequest(&INFO, [][]byte{})
	if err == nil {
		result = newFutureInfo(resp.future.(FutureBytes))
	}
	return result, err
}
581680
func GetServerInformation() (i ServerInformation, err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return
	}

	obj := conn.Object(DbusInterfacePath, DbusObjectPath)
	call := obj.Call(CallGetServerInformation, 0)
	if err = call.Err; err != nil {
		return
	}

	err = call.Store(&i.Name, &i.Vendor, &i.Version, &i.SpecVersion)
	return
}
836190
func (p *ProvisionerAPI) SetInstanceInfo(args params.InstancesInfo) (params.ErrorResults, error) {
	result := params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Machines)),
	}
	canAccess, err := p.getAuthFunc()
	if err != nil {
		return result, err
	}
	setInstanceInfo := func(arg params.InstanceInfo) error {
		tag, err := names.ParseMachineTag(arg.Tag)
		if err != nil {
			return common.ErrPerm
		}
		machine, err := p.getMachine(canAccess, tag)
		if err != nil {
			return err
		}
		volumes, err := storagecommon.VolumesToState(arg.Volumes)
		if err != nil {
			return err
		}
		volumeAttachments, err := storagecommon.VolumeAttachmentInfosToState(arg.VolumeAttachments)
		if err != nil {
			return err
		}

		devicesArgs, devicesAddrs := networkingcommon.NetworkConfigsToStateArgs(arg.NetworkConfig)

		err = machine.SetInstanceInfo(
			arg.InstanceId, arg.DisplayName, arg.Nonce, arg.Characteristics,
			devicesArgs, devicesAddrs,
			volumes, volumeAttachments, arg.CharmProfiles,
		)
		if err != nil {
			return errors.Annotatef(err, "cannot record provisioning info for %q", arg.InstanceId)
		}
		return nil
	}
	for i, arg := range args.Machines {
		err := setInstanceInfo(arg)
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
918787
func (p *ProvisionerAPI) PrepareContainerInterfaceInfo(args params.Entities) (
	params.MachineNetworkConfigResults,
	error,
) {
	return p.prepareOrGetContainerInterfaceInfo(args, false)
}