// Set image datastores.
779882
func (api *InfraAPI) SetImageDatastores(imageDatastores *ImageDatastores) (task *Task, err error) {
	body, err := json.Marshal(imageDatastores)
	if err != nil {
		return
	}

	res, err := api.client.restClient.Post(
		api.client.Endpoint+infraUrl+"/image-datastores",
		"application/json",
		bytes.NewReader(body),
		api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()

	task, err = getTask(getError(res))
	return
}
413801
func (s *attrStore) SetAttrs(id uint64, m map[string]interface{}) error {
	// Ignore empty maps.
	if len(m) == 0 {
		return nil
	}

	// Check if the attributes already exist under a read-only lock.
	if attr, err := s.Attrs(id); err != nil {
		return errors.Wrap(err, "checking attrs")
	} else if attr != nil && mapContains(attr, m) {
		return nil
	}

	// Obtain write lock.
	s.mu.Lock()
	defer s.mu.Unlock()

	var attr map[string]interface{}
	if err := s.db.Update(func(tx *bolt.Tx) error {
		tmp, err := txUpdateAttrs(tx, id, m)
		if err != nil {
			return err
		}
		attr = tmp

		return nil
	}); err != nil {
		return errors.Wrap(err, "updating store")
	}

	// Swap attributes map in cache.
	s.attrCache.Set(id, attr)

	return nil
}
170377
func (s *PipelineDeclaration) SetArtifactStores(v map[string]*ArtifactStore) *PipelineDeclaration {
	s.ArtifactStores = v
	return s
}
723807
func (c *listImagesCommand) SetFlags(f *gnuflag.FlagSet) {
	c.cloudImageMetadataCommandBase.SetFlags(f)

	f.StringVar(&c.Stream, "stream", "", "image metadata stream")
	f.StringVar(&c.Region, "region", "", "image metadata cloud region")

	f.Var(cmd.NewAppendStringsValue(&c.Series), "series", "only show cloud image metadata for these series")
	f.Var(cmd.NewAppendStringsValue(&c.Arches), "arch", "only show cloud image metadata for these architectures")

	f.StringVar(&c.VirtType, "virt-type", "", "image metadata virtualisation type")
	f.StringVar(&c.RootStorageType, "storage-type", "", "image metadata root storage type")

	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatMetadataListTabular,
	})
}
253136
func (d *OneToOne) Set(data GenericDataType) {
	idx := d.writeIndex % uint64(len(d.buffer))

	newBucket := &bucket{
		data: data,
		seq:  d.writeIndex,
	}
	d.writeIndex++

	atomic.StorePointer(&d.buffer[idx], unsafe.Pointer(newBucket))
}
439110
func (s *GRPCStorage) Set(ctx context.Context, msg *SetMsg) (*google_protobuf.Empty, error) {
	logrus.Debugf("storing: %s", msg.FileName)
	err := s.backend.Set(msg.FileName, msg.Data)
	if err != nil {
		logrus.Errorf("failed to store: %s", err.Error())
	}
	return &google_protobuf.Empty{}, err
}
18368
func (s *BatchGetImageInput) SetImageIds(v []*ImageIdentifier) *BatchGetImageInput {
	s.ImageIds = v
	return s
}
656359
func (s *DescribeStorediSCSIVolumesOutput) SetStorediSCSIVolumes(v []*StorediSCSIVolume) *DescribeStorediSCSIVolumesOutput {
	s.StorediSCSIVolumes = v
	return s
}
581971
func (s *ListImagesOutput) SetImageIds(v []*ImageIdentifier) *ListImagesOutput {
	s.ImageIds = v
	return s
}
42761
func (F *Frisby) SetDatas(datas map[string]string) *Frisby {
	if F.Req.Data == nil {
		F.Req.Data = make(map[string]string)
	}
	for key, value := range datas {
		F.Req.Data[key] = value
	}
	return F
}
1219080
func (s *UpdateStackInput) SetDeleteStorageConnectors(v bool) *UpdateStackInput {
	s.DeleteStorageConnectors = &v
	return s
}
1358096
func Datastore(ds ds.Batching) Option {
	return func(o *Options) error {
		o.Datastore = ds
		return nil
	}
}
531359
func (r *RedisStore) SetMaps(maps map[string]map[string]interface{}) error {
	_, err := r.Pipeline(func(r *RedisStore) error {
		for k, v := range maps {
			r.SetMap(k, v)
		}
		return nil

	})
	return err
}
1024979
func (G *global_data) SetDatas(datas map[string]string) *global_data {
	if G.Req.Data == nil {
		G.Req.Data = make(map[string]string)
	}
	for key, value := range datas {
		G.Req.Data[key] = value
	}
	return G
}
224371
func (c *Func) Set(key string, image *imageserver.Image, params imageserver.Params) error {
	return c.SetFunc(key, image, params)
}
7876
func (s *RemoteStore) Set(fileName string, data []byte) error {
	sm := &SetMsg{
		FileName: fileName,
		Data:     data,
	}
	ctx, cancel := s.getContext()
	defer cancel()
	_, err := s.client.Set(ctx, sm)
	return err
}
1210490
func dataStores() (blobserver.Storage, sorted.KeyValue, error) {
	dataDir := os.Getenv("CAMLI_GCE_DATA")
	if dataDir == "" {
		var err error
		dataDir, err = ioutil.TempDir("", "camli-gcedeployer-data")
		if err != nil {
			return nil, nil, err
		}
		log.Printf("data dir not provided as env var CAMLI_GCE_DATA, so defaulting to %v", dataDir)
	}
	blobsDir := filepath.Join(dataDir, "instance-conf")
	if err := os.MkdirAll(blobsDir, 0700); err != nil {
		return nil, nil, err
	}
	instConf, err := localdisk.New(blobsDir)
	if err != nil {
		return nil, nil, err
	}
	instState, err := leveldb.NewStorage(filepath.Join(dataDir, "instance-state"))
	if err != nil {
		return nil, nil, err
	}
	return instConf, instState, nil
}