// Depending on the disk type network or local, initialize storage API.
978936
func newStorageAPI(endpoint Endpoint) (storage StorageAPI, err error) {
	if endpoint.IsLocal {
		return newPosix(endpoint.Path)
	}

	return newStorageRESTClient(endpoint)
}
594342
func (o *OracleEnviron) StorageProviderTypes() ([]storage.ProviderType, error) {
	if access, err := o.canAccessStorageAPI(); access {
		return []storage.ProviderType{oracleStorageProviderType}, nil
	} else {
		return nil, errors.Trace(err)
	}
}
213193
func (ccpack *CDSPackage) InitFromFS(ccname string, ccversion string) ([]byte, *pb.ChaincodeDeploymentSpec, error) {
	return ccpack.InitFromPath(ccname, ccversion, chaincodeInstallPath)
}
1031200
func Init(storeDriver string, storeURLs []string) error {
	var err error

	// Create an objdb client
	ObjdbClient, err = objdb.InitClient(storeDriver, storeURLs)

	return err
}
1277849
func (api *InterfaceAPI) CreateAndConnectToServer(serverID int64) (*sacloud.Interface, error) {
	iface := api.New()
	iface.Server = &sacloud.Server{
		// Resource
		Resource: &sacloud.Resource{ID: serverID},
	}
	return api.Create(iface)
}
1139615
func (self *Boxfile) AddStorageNode() {
  for _, node := range self.Nodes() {
    name := regexp.MustCompile(`\d+`).ReplaceAllString(node, "")
    if (name == "web" || name == "worker") && self.Node(node).Value("network_dirs") != nil {
      found := false
      for _, storage := range self.Node(node).Node("network_dirs").Nodes() {
        found = true
        if !self.Node(storage).Valid {
          self.Parsed[storage] = map[string]interface{}{"found": true}
        }
      }

      // if i dont find anything but they did have a network_dirs.. just try adding a new one
      if !found {
        if !self.Node("nfs1").Valid {
          self.Parsed["nfs1"] = map[string]interface{}{"found": true}
        }
      }
    }
  }
}
716798
func (*maasEnviron) StorageProvider(t storage.ProviderType) (storage.Provider, error) {
	if t == maasStorageProviderType {
		return maasStorageProvider{}, nil
	}
	return nil, errors.NotFoundf("storage provider %q", t)
}
154769
func (s *OrderableReplicationInstance) SetStorageType(v string) *OrderableReplicationInstance {
	s.StorageType = &v
	return s
}
919339
func newStorageAPI(
	backend backend,
	storage storageAccess,
	resources facade.Resources,
	accessUnit common.GetAuthFunc,
) (*StorageAPI, error) {

	return &StorageAPI{
		backend:    backend,
		storage:    storage,
		resources:  resources,
		accessUnit: accessUnit,
	}, nil
}
386509
func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface {
	return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake}
}
761228
func (r ChainedProviderRegistry) StorageProviderTypes() ([]ProviderType, error) {
	var result []ProviderType
	for _, r := range r {
		types, err := r.StorageProviderTypes()
		if err != nil {
			return nil, errors.Trace(err)
		}
		result = append(result, types...)
	}
	return result, nil
}
675108
func Init(params map[string]string) (volume.VolumeDriver, error) {
	url, ok := params[config.UrlKey]
	if !ok {
		url = DefaultUrl
	}
	version, ok := params[config.VersionKey]
	if !ok {
		version = volume.APIVersion
	}
	c, err := client.NewClient(url, version, "")
	if err != nil {
		return nil, err
	}

	return &driver{VolumeDriver: volumeclient.VolumeDriver(c)}, nil
}
226602
func (o *InitializeParams) SetDiskType(v *string) *InitializeParams {
	if o.DiskType = v; o.DiskType == nil {
		o.nullFields = append(o.nullFields, "DiskType")
	}
	return o
}
495186
func init() {
	docsProvider := func() map[string]interface{} {
		docs := make(map[string]interface{})

		docs["types"] = DefaultTypes
		return docs
	}

	docshelper.AddDocProvider("media", docsProvider)
}
626840
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error {
	c := driverapi.Capability{
		DataScope:         datastore.LocalScope,
		ConnectivityScope: datastore.GlobalScope,
	}
	d := &driver{
		networks: networkTable{},
	}
	d.initStore(config)

	return dc.RegisterDriver(ipvlanType, d, c)
}
794089
func (web *webAPIHandlers) StorageInfo(r *http.Request, args *WebGenericArgs, reply *StorageInfoRep) error {
	objectAPI := web.ObjectAPI()
	if objectAPI == nil {
		return toJSONError(errServerNotInitialized)
	}
	_, _, authErr := webRequestAuthenticate(r)
	if authErr != nil {
		return toJSONError(authErr)
	}
	reply.StorageInfo = objectAPI.StorageInfo(context.Background())
	reply.UIVersion = browser.UIVersion
	return nil
}
790156
func (c *Clientset) StorageV1() storagev1.StorageV1Interface {
	return &fakestoragev1.FakeStorageV1{Fake: &c.Fake}
}