// SetVolumeInfo records the details of newly provisioned volumes.
421479
func (st *State) SetVolumeInfo(volumes []params.Volume) ([]params.ErrorResult, error) {
	args := params.Volumes{Volumes: volumes}
	var results params.ErrorResults
	err := st.facade.FacadeCall("SetVolumeInfo", args, &results)
	if err != nil {
		return nil, err
	}
	if len(results.Results) != len(volumes) {
		return nil, errors.Errorf("expected %d result(s), got %d", len(volumes), len(results.Results))
	}
	return results.Results, nil
}
922145
func (s *AttachVolumeInput) SetVolumeARN(v string) *AttachVolumeInput {
	s.VolumeARN = &v
	return s
}
1360774
func (s *InstanceHealthSummary) SetInfo(v int64) *InstanceHealthSummary {
	s.Info = &v
	return s
}
267704
func (s *StorageProvisionerAPIv3) SetFilesystemInfo(args params.Filesystems) (params.ErrorResults, error) {
	canAccessFilesystem, err := s.getStorageEntityAuthFunc()
	if err != nil {
		return params.ErrorResults{}, err
	}
	results := params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Filesystems)),
	}
	one := func(arg params.Filesystem) error {
		filesystemTag, filesystemInfo, err := storagecommon.FilesystemToState(arg)
		if err != nil {
			return errors.Trace(err)
		} else if !canAccessFilesystem(filesystemTag) {
			return common.ErrPerm
		}
		err = s.sb.SetFilesystemInfo(filesystemTag, filesystemInfo)
		if errors.IsNotFound(err) {
			return common.ErrPerm
		}
		return errors.Trace(err)
	}
	for i, arg := range args.Filesystems {
		err := one(arg)
		results.Results[i].Error = common.ServerError(err)
	}
	return results, nil
}
914972
func (s *EBSStorageInfo) SetVolumeSize(v int64) *EBSStorageInfo {
	s.VolumeSize = &v
	return s
}
746677
func (s *StorediSCSIVolume) SetVolumeSizeInBytes(v int64) *StorediSCSIVolume {
	s.VolumeSizeInBytes = &v
	return s
}
272230
func (s *CachediSCSIVolume) SetVolumeARN(v string) *CachediSCSIVolume {
	s.VolumeARN = &v
	return s
}
1078007
func (s *StorediSCSIVolume) SetVolumeUsedInBytes(v int64) *StorediSCSIVolume {
	s.VolumeUsedInBytes = &v
	return s
}
504729
func (s *CreateSnapshotOutput) SetVolumeARN(v string) *CreateSnapshotOutput {
	s.VolumeARN = &v
	return s
}
430948
func (s *DescribeVolumesOutput) SetVolumes(v []*Volume) *DescribeVolumesOutput {
	s.Volumes = v
	return s
}
225072
func (s *ChangeResourceRecordSetsOutput) SetChangeInfo(v *ChangeInfo) *ChangeResourceRecordSetsOutput {
	s.ChangeInfo = v
	return s
}
490337
func (s *DescribeSnapshotScheduleInput) SetVolumeARN(v string) *DescribeSnapshotScheduleInput {
	s.VolumeARN = &v
	return s
}
431801
func (s *UpdateDeploymentGroupInput) SetLoadBalancerInfo(v *LoadBalancerInfo) *UpdateDeploymentGroupInput {
	s.LoadBalancerInfo = v
	return s
}
711607
func (s *DeleteSnapshotScheduleOutput) SetVolumeARN(v string) *DeleteSnapshotScheduleOutput {
	s.VolumeARN = &v
	return s
}
261745
func (s *UnassignVolumeInput) SetVolumeId(v string) *UnassignVolumeInput {
	s.VolumeId = &v
	return s
}
451455
func (s *EbsBlockDeviceConfig) SetVolumeSpecification(v *VolumeSpecification) *EbsBlockDeviceConfig {
	s.VolumeSpecification = v
	return s
}
307867
func (sb *storageBackend) SetVolumeInfo(tag names.VolumeTag, info VolumeInfo) (err error) {
	defer errors.DeferredAnnotatef(&err, "cannot set info for volume %q", tag.Id())
	if info.VolumeId == "" {
		return errors.New("volume ID not set")
	}
	// TODO(axw) we should reject info without VolumeId set; can't do this
	// until the providers all set it correctly.
	buildTxn := func(attempt int) ([]txn.Op, error) {
		v, err := sb.Volume(tag)
		if err != nil {
			return nil, errors.Trace(err)
		}
		// If the volume has parameters, unset them when
		// we set info for the first time, ensuring that
		// params and info are mutually exclusive.
		var unsetParams bool
		var ops []txn.Op
		if params, ok := v.Params(); ok {
			info.Pool = params.Pool
			unsetParams = true
		} else {
			// Ensure immutable properties do not change.
			oldInfo, err := v.Info()
			if err != nil {
				return nil, err
			}
			if err := validateVolumeInfoChange(info, oldInfo); err != nil {
				return nil, err
			}
		}
		ops = append(ops, setVolumeInfoOps(tag, info, unsetParams)...)
		return ops, nil
	}
	return sb.mb.db().Run(buildTxn)
}