id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
22,000
libopenstorage/openstorage
alerts/api.go
NewRaiseRule
func NewRaiseRule(name string, filter Filter, action Action) Rule { return &rule{name: name, event: raiseEvent, filter: filter, action: action} }
go
func NewRaiseRule(name string, filter Filter, action Action) Rule { return &rule{name: name, event: raiseEvent, filter: filter, action: action} }
[ "func", "NewRaiseRule", "(", "name", "string", ",", "filter", "Filter", ",", "action", "Action", ")", "Rule", "{", "return", "&", "rule", "{", "name", ":", "name", ",", "event", ":", "raiseEvent", ",", "filter", ":", "filter", ",", "action", ":", "acti...
// Rule API // NewRaiseRule creates a rule that runs action when a raised alerts matche filter. // Action happens before incoming alert is raised.
[ "Rule", "API", "NewRaiseRule", "creates", "a", "rule", "that", "runs", "action", "when", "a", "raised", "alerts", "matche", "filter", ".", "Action", "happens", "before", "incoming", "alert", "is", "raised", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/alerts/api.go#L141-L143
22,001
libopenstorage/openstorage
alerts/api.go
NewDeleteRule
func NewDeleteRule(name string, filter Filter, action Action) Rule { return &rule{name: name, event: deleteEvent, filter: filter, action: action} }
go
func NewDeleteRule(name string, filter Filter, action Action) Rule { return &rule{name: name, event: deleteEvent, filter: filter, action: action} }
[ "func", "NewDeleteRule", "(", "name", "string", ",", "filter", "Filter", ",", "action", "Action", ")", "Rule", "{", "return", "&", "rule", "{", "name", ":", "name", ",", "event", ":", "deleteEvent", ",", "filter", ":", "filter", ",", "action", ":", "ac...
// NewDeleteRule creates a rule that runs action when deleted alerts matche filter. // Action happens after matching alerts are deleted.
[ "NewDeleteRule", "creates", "a", "rule", "that", "runs", "action", "when", "deleted", "alerts", "matche", "filter", ".", "Action", "happens", "after", "matching", "alerts", "are", "deleted", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/alerts/api.go#L147-L149
22,002
libopenstorage/openstorage
volume/volume.go
NewVolumeDriverRegistry
func NewVolumeDriverRegistry(nameToInitFunc map[string]func(map[string]string) (VolumeDriver, error)) VolumeDriverRegistry { return newVolumeDriverRegistry(nameToInitFunc) }
go
func NewVolumeDriverRegistry(nameToInitFunc map[string]func(map[string]string) (VolumeDriver, error)) VolumeDriverRegistry { return newVolumeDriverRegistry(nameToInitFunc) }
[ "func", "NewVolumeDriverRegistry", "(", "nameToInitFunc", "map", "[", "string", "]", "func", "(", "map", "[", "string", "]", "string", ")", "(", "VolumeDriver", ",", "error", ")", ")", "VolumeDriverRegistry", "{", "return", "newVolumeDriverRegistry", "(", "nameT...
// NewVolumeDriverRegistry constructs a new VolumeDriverRegistry.
[ "NewVolumeDriverRegistry", "constructs", "a", "new", "VolumeDriverRegistry", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/volume.go#L294-L296
22,003
libopenstorage/openstorage
volume/drivers/btrfs/btrfs.go
Create
func (d *driver) Create( locator *api.VolumeLocator, source *api.Source, spec *api.VolumeSpec, ) (string, error) { if spec.Format != api.FSType_FS_TYPE_BTRFS && spec.Format != api.FSType_FS_TYPE_NONE { return "", fmt.Errorf("Filesystem format (%v) must be %v", spec.Format.SimpleString(), api.FSType_FS_TYPE_BTRFS....
go
func (d *driver) Create( locator *api.VolumeLocator, source *api.Source, spec *api.VolumeSpec, ) (string, error) { if spec.Format != api.FSType_FS_TYPE_BTRFS && spec.Format != api.FSType_FS_TYPE_NONE { return "", fmt.Errorf("Filesystem format (%v) must be %v", spec.Format.SimpleString(), api.FSType_FS_TYPE_BTRFS....
[ "func", "(", "d", "*", "driver", ")", "Create", "(", "locator", "*", "api", ".", "VolumeLocator", ",", "source", "*", "api", ".", "Source", ",", "spec", "*", "api", ".", "VolumeSpec", ",", ")", "(", "string", ",", "error", ")", "{", "if", "spec", ...
// Create a new subvolume. The volume spec is not taken into account.
[ "Create", "a", "new", "subvolume", ".", "The", "volume", "spec", "is", "not", "taken", "into", "account", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/btrfs/btrfs.go#L81-L108
22,004
libopenstorage/openstorage
volume/drivers/btrfs/btrfs.go
Snapshot
func (d *driver) Snapshot(volumeID string, readonly bool, locator *api.VolumeLocator, noRetry bool) (string, error) { vols, err := d.Inspect([]string{volumeID}) if err != nil { return "", err } if len(vols) != 1 { return "", fmt.Errorf("Failed to inspect %v len %v", volumeID, len(vols)) } snapID := uuid.New()...
go
func (d *driver) Snapshot(volumeID string, readonly bool, locator *api.VolumeLocator, noRetry bool) (string, error) { vols, err := d.Inspect([]string{volumeID}) if err != nil { return "", err } if len(vols) != 1 { return "", fmt.Errorf("Failed to inspect %v len %v", volumeID, len(vols)) } snapID := uuid.New()...
[ "func", "(", "d", "*", "driver", ")", "Snapshot", "(", "volumeID", "string", ",", "readonly", "bool", ",", "locator", "*", "api", ".", "VolumeLocator", ",", "noRetry", "bool", ")", "(", "string", ",", "error", ")", "{", "vols", ",", "err", ":=", "d",...
// Snapshot create new subvolume from volume
[ "Snapshot", "create", "new", "subvolume", "from", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/btrfs/btrfs.go#L160-L183
22,005
libopenstorage/openstorage
osdconfig/new.go
newCaller
func newCaller(kv kvdb.Kvdb) (*configManager, error) { manager := new(configManager) manager.cbCluster = make(map[string]CallbackClusterConfigFunc) manager.cbNode = make(map[string]CallbackNodeConfigFunc) // kvdb pointer manager.kv = kv return manager, nil }
go
func newCaller(kv kvdb.Kvdb) (*configManager, error) { manager := new(configManager) manager.cbCluster = make(map[string]CallbackClusterConfigFunc) manager.cbNode = make(map[string]CallbackNodeConfigFunc) // kvdb pointer manager.kv = kv return manager, nil }
[ "func", "newCaller", "(", "kv", "kvdb", ".", "Kvdb", ")", "(", "*", "configManager", ",", "error", ")", "{", "manager", ":=", "new", "(", "configManager", ")", "\n\n", "manager", ".", "cbCluster", "=", "make", "(", "map", "[", "string", "]", "CallbackC...
// newCaller can be used to instantiate configManager, // however, it is exported as ConfigCaller and avoids // starting kvdb watches. // Those not needing kvdb wtches should use this instead of // config manager.
[ "newCaller", "can", "be", "used", "to", "instantiate", "configManager", "however", "it", "is", "exported", "as", "ConfigCaller", "and", "avoids", "starting", "kvdb", "watches", ".", "Those", "not", "needing", "kvdb", "wtches", "should", "use", "this", "instead",...
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/osdconfig/new.go#L56-L66
22,006
libopenstorage/openstorage
pkg/storageops/vsphere/vsphere_util.go
IsDevMode
func IsDevMode() bool { _, err := storageops.GetEnvValueStrict("VSPHERE_VM_UUID") if err != nil { return false } _, err = storageops.GetEnvValueStrict("VSPHERE_TEST_DATASTORE") return err == nil }
go
func IsDevMode() bool { _, err := storageops.GetEnvValueStrict("VSPHERE_VM_UUID") if err != nil { return false } _, err = storageops.GetEnvValueStrict("VSPHERE_TEST_DATASTORE") return err == nil }
[ "func", "IsDevMode", "(", ")", "bool", "{", "_", ",", "err", ":=", "storageops", ".", "GetEnvValueStrict", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "false", "\n", "}", "\n\n", "_", ",", "err", "=", "storageops", ".", "Ge...
// IsDevMode checks if requirement env variables are set to run the pkg outside vsphere in dev mode
[ "IsDevMode", "checks", "if", "requirement", "env", "variables", "are", "set", "to", "run", "the", "pkg", "outside", "vsphere", "in", "dev", "mode" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/vsphere/vsphere_util.go#L94-L102
22,007
libopenstorage/openstorage
pkg/storageops/vsphere/vsphere_util.go
GetStoragePodMoList
func GetStoragePodMoList( ctx context.Context, client *vim25.Client, storagePodRefs []types.ManagedObjectReference, properties []string) ([]mo.StoragePod, error) { var storagePodMoList []mo.StoragePod pc := property.DefaultCollector(client) err := pc.Retrieve(ctx, storagePodRefs, properties, &storagePodMoList) ...
go
func GetStoragePodMoList( ctx context.Context, client *vim25.Client, storagePodRefs []types.ManagedObjectReference, properties []string) ([]mo.StoragePod, error) { var storagePodMoList []mo.StoragePod pc := property.DefaultCollector(client) err := pc.Retrieve(ctx, storagePodRefs, properties, &storagePodMoList) ...
[ "func", "GetStoragePodMoList", "(", "ctx", "context", ".", "Context", ",", "client", "*", "vim25", ".", "Client", ",", "storagePodRefs", "[", "]", "types", ".", "ManagedObjectReference", ",", "properties", "[", "]", "string", ")", "(", "[", "]", "mo", ".",...
// GetStoragePodMoList fetches the managed storage pod objects for the given references // Only the properties is the given property list will be populated in the response
[ "GetStoragePodMoList", "fetches", "the", "managed", "storage", "pod", "objects", "for", "the", "given", "references", "Only", "the", "properties", "is", "the", "given", "property", "list", "will", "be", "populated", "in", "the", "response" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/vsphere/vsphere_util.go#L171-L185
22,008
libopenstorage/openstorage
api/server/sdk/volume_migrate.go
Start
func (s *VolumeServer) Start( ctx context.Context, req *api.SdkCloudMigrateStartRequest, ) (*api.SdkCloudMigrateStartResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if volume := req.GetVolume(); volume != nil {...
go
func (s *VolumeServer) Start( ctx context.Context, req *api.SdkCloudMigrateStartRequest, ) (*api.SdkCloudMigrateStartResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if volume := req.GetVolume(); volume != nil {...
[ "func", "(", "s", "*", "VolumeServer", ")", "Start", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkCloudMigrateStartRequest", ",", ")", "(", "*", "api", ".", "SdkCloudMigrateStartResponse", ",", "error", ")", "{", "if", "s", "."...
// Start a volume migration
[ "Start", "a", "volume", "migration" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_migrate.go#L29-L63
22,009
libopenstorage/openstorage
api/server/sdk/volume_migrate.go
Cancel
func (s *VolumeServer) Cancel( ctx context.Context, req *api.SdkCloudMigrateCancelRequest, ) (*api.SdkCloudMigrateCancelResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if req.GetRequest() == nil { return nil,...
go
func (s *VolumeServer) Cancel( ctx context.Context, req *api.SdkCloudMigrateCancelRequest, ) (*api.SdkCloudMigrateCancelResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if req.GetRequest() == nil { return nil,...
[ "func", "(", "s", "*", "VolumeServer", ")", "Cancel", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkCloudMigrateCancelRequest", ",", ")", "(", "*", "api", ".", "SdkCloudMigrateCancelResponse", ",", "error", ")", "{", "if", "s", ...
// Cancel or stop a ongoing migration
[ "Cancel", "or", "stop", "a", "ongoing", "migration" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_migrate.go#L166-L185
22,010
libopenstorage/openstorage
api/server/sdk/volume_migrate.go
Status
func (s *VolumeServer) Status( ctx context.Context, req *api.SdkCloudMigrateStatusRequest, ) (*api.SdkCloudMigrateStatusResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } resp, err := s.driver(ctx).CloudMigrateSta...
go
func (s *VolumeServer) Status( ctx context.Context, req *api.SdkCloudMigrateStatusRequest, ) (*api.SdkCloudMigrateStatusResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } resp, err := s.driver(ctx).CloudMigrateSta...
[ "func", "(", "s", "*", "VolumeServer", ")", "Status", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkCloudMigrateStatusRequest", ",", ")", "(", "*", "api", ".", "SdkCloudMigrateStatusResponse", ",", "error", ")", "{", "if", "s", ...
// Status of ongoing migration
[ "Status", "of", "ongoing", "migration" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_migrate.go#L188-L204
22,011
libopenstorage/openstorage
volume/drivers/pwx/pwx.go
Init
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{V...
go
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{V...
[ "func", "Init", "(", "params", "map", "[", "string", "]", "string", ")", "(", "volume", ".", "VolumeDriver", ",", "error", ")", "{", "url", ",", "ok", ":=", "params", "[", "config", ".", "UrlKey", "]", "\n", "if", "!", "ok", "{", "url", "=", "Def...
// Init initialized the Portworx driver. // Portworx natively implements the openstorage.org API specification, so // we can directly point the VolumeDriver to the PWX API server.
[ "Init", "initialized", "the", "Portworx", "driver", ".", "Portworx", "natively", "implements", "the", "openstorage", ".", "org", "API", "specification", "so", "we", "can", "directly", "point", "the", "VolumeDriver", "to", "the", "PWX", "API", "server", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/pwx/pwx.go#L27-L42
22,012
libopenstorage/openstorage
cluster/manager/pair.go
CreatePair
func (c *ClusterManager) CreatePair( request *api.ClusterPairCreateRequest, ) (*api.ClusterPairCreateResponse, error) { remoteIp := request.RemoteClusterIp // Pair with remote server logrus.Infof("Attempting to pair with cluster at IP %v", remoteIp) processRequest := &api.ClusterPairProcessRequest{ SourceCluste...
go
func (c *ClusterManager) CreatePair( request *api.ClusterPairCreateRequest, ) (*api.ClusterPairCreateResponse, error) { remoteIp := request.RemoteClusterIp // Pair with remote server logrus.Infof("Attempting to pair with cluster at IP %v", remoteIp) processRequest := &api.ClusterPairProcessRequest{ SourceCluste...
[ "func", "(", "c", "*", "ClusterManager", ")", "CreatePair", "(", "request", "*", "api", ".", "ClusterPairCreateRequest", ",", ")", "(", "*", "api", ".", "ClusterPairCreateResponse", ",", "error", ")", "{", "remoteIp", ":=", "request", ".", "RemoteClusterIp", ...
// CreatePair remote pairs this cluster with a remote cluster.
[ "CreatePair", "remote", "pairs", "this", "cluster", "with", "a", "remote", "cluster", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/cluster/manager/pair.go#L27-L90
22,013
libopenstorage/openstorage
cluster/manager/pair.go
ProcessPairRequest
func (c *ClusterManager) ProcessPairRequest( request *api.ClusterPairProcessRequest, ) (*api.ClusterPairProcessResponse, error) { if request.SourceClusterId == c.Uuid() { return nil, fmt.Errorf("Cannot create cluster pair with self") } response := &api.ClusterPairProcessResponse{ RemoteClusterId: c.Uuid(), ...
go
func (c *ClusterManager) ProcessPairRequest( request *api.ClusterPairProcessRequest, ) (*api.ClusterPairProcessResponse, error) { if request.SourceClusterId == c.Uuid() { return nil, fmt.Errorf("Cannot create cluster pair with self") } response := &api.ClusterPairProcessResponse{ RemoteClusterId: c.Uuid(), ...
[ "func", "(", "c", "*", "ClusterManager", ")", "ProcessPairRequest", "(", "request", "*", "api", ".", "ClusterPairProcessRequest", ",", ")", "(", "*", "api", ".", "ClusterPairProcessResponse", ",", "error", ")", "{", "if", "request", ".", "SourceClusterId", "==...
// ProcessPairRequest handles a remote cluster's pair request
[ "ProcessPairRequest", "handles", "a", "remote", "cluster", "s", "pair", "request" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/cluster/manager/pair.go#L93-L133
22,014
libopenstorage/openstorage
cluster/manager/pair.go
getDefaultPairId
func getDefaultPairId() (string, error) { kv := kvdb.Instance() kvp, err := kv.Get(clusterPairDefaultKey) if err != nil { return "", err } return string(kvp.Value), nil }
go
func getDefaultPairId() (string, error) { kv := kvdb.Instance() kvp, err := kv.Get(clusterPairDefaultKey) if err != nil { return "", err } return string(kvp.Value), nil }
[ "func", "getDefaultPairId", "(", ")", "(", "string", ",", "error", ")", "{", "kv", ":=", "kvdb", ".", "Instance", "(", ")", "\n", "kvp", ",", "err", ":=", "kv", ".", "Get", "(", "clusterPairDefaultKey", ")", "\n", "if", "err", "!=", "nil", "{", "re...
// Return the default pair id if set, error if none set
[ "Return", "the", "default", "pair", "id", "if", "set", "error", "if", "none", "set" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/cluster/manager/pair.go#L424-L431
22,015
libopenstorage/openstorage
pkg/flexvolume/flexvolume.pb.gw.go
RegisterAPIHandler
func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { return RegisterAPIHandlerClient(ctx, mux, NewAPIClient(conn)) }
go
func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { return RegisterAPIHandlerClient(ctx, mux, NewAPIClient(conn)) }
[ "func", "RegisterAPIHandler", "(", "ctx", "context", ".", "Context", ",", "mux", "*", "runtime", ".", "ServeMux", ",", "conn", "*", "grpc", ".", "ClientConn", ")", "error", "{", "return", "RegisterAPIHandlerClient", "(", "ctx", ",", "mux", ",", "NewAPIClient...
// RegisterAPIHandler registers the http handlers for service API to "mux". // The handlers forward requests to the grpc endpoint over "conn".
[ "RegisterAPIHandler", "registers", "the", "http", "handlers", "for", "service", "API", "to", "mux", ".", "The", "handlers", "forward", "requests", "to", "the", "grpc", "endpoint", "over", "conn", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/flexvolume/flexvolume.pb.gw.go#L124-L126
22,016
libopenstorage/openstorage
pkg/sanity/sanity.go
CloudProviderConfigParse
func CloudProviderConfigParse(filePath string) (*CloudBackupConfig, error) { config := &CloudBackupConfig{} data, err := ioutil.ReadFile(filePath) if err != nil { return nil, fmt.Errorf("Unable to read the Cloud backup configuration file (%s): %s", filePath, err.Error()) } if err := yaml.Unmarshal(data, config)...
go
func CloudProviderConfigParse(filePath string) (*CloudBackupConfig, error) { config := &CloudBackupConfig{} data, err := ioutil.ReadFile(filePath) if err != nil { return nil, fmt.Errorf("Unable to read the Cloud backup configuration file (%s): %s", filePath, err.Error()) } if err := yaml.Unmarshal(data, config)...
[ "func", "CloudProviderConfigParse", "(", "filePath", "string", ")", "(", "*", "CloudBackupConfig", ",", "error", ")", "{", "config", ":=", "&", "CloudBackupConfig", "{", "}", "\n", "data", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "filePath", ")", ...
// CloudProviderConfigParse parses the config file of cloudBackup
[ "CloudProviderConfigParse", "parses", "the", "config", "file", "of", "cloudBackup" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/sanity/sanity.go#L65-L77
22,017
libopenstorage/openstorage
volume/drivers/drivers.go
Register
func Register(name string, params map[string]string) error { return volumeDriverRegistry.Register(name, params) }
go
func Register(name string, params map[string]string) error { return volumeDriverRegistry.Register(name, params) }
[ "func", "Register", "(", "name", "string", ",", "params", "map", "[", "string", "]", "string", ")", "error", "{", "return", "volumeDriverRegistry", ".", "Register", "(", "name", ",", "params", ")", "\n", "}" ]
// Register registers a new driver.
[ "Register", "registers", "a", "new", "driver", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/drivers.go#L62-L64
22,018
libopenstorage/openstorage
volume/drivers/drivers.go
Add
func Add(name string, init func(map[string]string) (volume.VolumeDriver, error)) error { return volumeDriverRegistry.Add(name, init) }
go
func Add(name string, init func(map[string]string) (volume.VolumeDriver, error)) error { return volumeDriverRegistry.Add(name, init) }
[ "func", "Add", "(", "name", "string", ",", "init", "func", "(", "map", "[", "string", "]", "string", ")", "(", "volume", ".", "VolumeDriver", ",", "error", ")", ")", "error", "{", "return", "volumeDriverRegistry", ".", "Add", "(", "name", ",", "init", ...
// Add adds a new driver.
[ "Add", "adds", "a", "new", "driver", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/drivers.go#L67-L69
22,019
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Create
func (s *VolumeServer) Create( ctx context.Context, req *api.SdkVolumeCreateRequest, ) (*api.SdkVolumeCreateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetName()) == 0 { return nil, status.Erro...
go
func (s *VolumeServer) Create( ctx context.Context, req *api.SdkVolumeCreateRequest, ) (*api.SdkVolumeCreateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetName()) == 0 { return nil, status.Erro...
[ "func", "(", "s", "*", "VolumeServer", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeCreateRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeCreateResponse", ",", "error", ")", "{", "if", "s", ".", "clus...
// Create creates a new volume
[ "Create", "creates", "a", "new", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L144-L193
22,020
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Clone
func (s *VolumeServer) Clone( ctx context.Context, req *api.SdkVolumeCloneRequest, ) (*api.SdkVolumeCloneResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetName()) == 0 { return nil, status.Error( ...
go
func (s *VolumeServer) Clone( ctx context.Context, req *api.SdkVolumeCloneRequest, ) (*api.SdkVolumeCloneResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetName()) == 0 { return nil, status.Error( ...
[ "func", "(", "s", "*", "VolumeServer", ")", "Clone", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeCloneRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeCloneResponse", ",", "error", ")", "{", "if", "s", ".", "cluster...
// Clone creates a new volume from an existing volume
[ "Clone", "creates", "a", "new", "volume", "from", "an", "existing", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L196-L239
22,021
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Delete
func (s *VolumeServer) Delete( ctx context.Context, req *api.SdkVolumeDeleteRequest, ) (*api.SdkVolumeDeleteResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status....
go
func (s *VolumeServer) Delete( ctx context.Context, req *api.SdkVolumeDeleteRequest, ) (*api.SdkVolumeDeleteResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status....
[ "func", "(", "s", "*", "VolumeServer", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeDeleteRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeDeleteResponse", ",", "error", ")", "{", "if", "s", ".", "clus...
// Delete deletes a volume
[ "Delete", "deletes", "a", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L242-L283
22,022
libopenstorage/openstorage
api/server/sdk/volume_ops.go
InspectWithFilters
func (s *VolumeServer) InspectWithFilters( ctx context.Context, req *api.SdkVolumeInspectWithFiltersRequest, ) (*api.SdkVolumeInspectWithFiltersResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } var locator *api.V...
go
func (s *VolumeServer) InspectWithFilters( ctx context.Context, req *api.SdkVolumeInspectWithFiltersRequest, ) (*api.SdkVolumeInspectWithFiltersResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } var locator *api.V...
[ "func", "(", "s", "*", "VolumeServer", ")", "InspectWithFilters", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeInspectWithFiltersRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeInspectWithFiltersResponse", ",", "error", ")", ...
// InspectWithFilters is a helper function returning information about volumes which match a filter
[ "InspectWithFilters", "is", "a", "helper", "function", "returning", "information", "about", "volumes", "which", "match", "a", "filter" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L286-L346
22,023
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Inspect
func (s *VolumeServer) Inspect( ctx context.Context, req *api.SdkVolumeInspectRequest, ) (*api.SdkVolumeInspectResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, stat...
go
func (s *VolumeServer) Inspect( ctx context.Context, req *api.SdkVolumeInspectRequest, ) (*api.SdkVolumeInspectResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, stat...
[ "func", "(", "s", "*", "VolumeServer", ")", "Inspect", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeInspectRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeInspectResponse", ",", "error", ")", "{", "if", "s", ".", "c...
// Inspect returns information about a volume
[ "Inspect", "returns", "information", "about", "a", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L349-L405
22,024
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Enumerate
func (s *VolumeServer) Enumerate( ctx context.Context, req *api.SdkVolumeEnumerateRequest, ) (*api.SdkVolumeEnumerateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } resp, err := s.EnumerateWithFilters( ctx, ...
go
func (s *VolumeServer) Enumerate( ctx context.Context, req *api.SdkVolumeEnumerateRequest, ) (*api.SdkVolumeEnumerateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } resp, err := s.EnumerateWithFilters( ctx, ...
[ "func", "(", "s", "*", "VolumeServer", ")", "Enumerate", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeEnumerateRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeEnumerateResponse", ",", "error", ")", "{", "if", "s", "."...
// Enumerate returns a list of volumes
[ "Enumerate", "returns", "a", "list", "of", "volumes" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L408-L428
22,025
libopenstorage/openstorage
api/server/sdk/volume_ops.go
EnumerateWithFilters
func (s *VolumeServer) EnumerateWithFilters( ctx context.Context, req *api.SdkVolumeEnumerateWithFiltersRequest, ) (*api.SdkVolumeEnumerateWithFiltersResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } var locator ...
go
func (s *VolumeServer) EnumerateWithFilters( ctx context.Context, req *api.SdkVolumeEnumerateWithFiltersRequest, ) (*api.SdkVolumeEnumerateWithFiltersResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } var locator ...
[ "func", "(", "s", "*", "VolumeServer", ")", "EnumerateWithFilters", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeEnumerateWithFiltersRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeEnumerateWithFiltersResponse", ",", "error", ...
// EnumerateWithFilters returns a list of volumes for the provided filters
[ "EnumerateWithFilters", "returns", "a", "list", "of", "volumes", "for", "the", "provided", "filters" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L431-L470
22,026
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Update
func (s *VolumeServer) Update( ctx context.Context, req *api.SdkVolumeUpdateRequest, ) (*api.SdkVolumeUpdateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status....
go
func (s *VolumeServer) Update( ctx context.Context, req *api.SdkVolumeUpdateRequest, ) (*api.SdkVolumeUpdateResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status....
[ "func", "(", "s", "*", "VolumeServer", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeUpdateRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeUpdateResponse", ",", "error", ")", "{", "if", "s", ".", "clus...
// Update allows the caller to change values in the volume specification
[ "Update", "allows", "the", "caller", "to", "change", "values", "in", "the", "volume", "specification" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L473-L535
22,027
libopenstorage/openstorage
api/server/sdk/volume_ops.go
Stats
func (s *VolumeServer) Stats( ctx context.Context, req *api.SdkVolumeStatsRequest, ) (*api.SdkVolumeStatsResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status.Err...
go
func (s *VolumeServer) Stats( ctx context.Context, req *api.SdkVolumeStatsRequest, ) (*api.SdkVolumeStatsResponse, error) { if s.cluster() == nil || s.driver(ctx) == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status.Err...
[ "func", "(", "s", "*", "VolumeServer", ")", "Stats", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkVolumeStatsRequest", ",", ")", "(", "*", "api", ".", "SdkVolumeStatsResponse", ",", "error", ")", "{", "if", "s", ".", "cluster...
// Stats returns volume statistics
[ "Stats", "returns", "volume", "statistics" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L538-L567
22,028
libopenstorage/openstorage
api/server/sdk/volume_ops.go
GetDefaultVolSpecs
func GetDefaultVolSpecs( ctx context.Context, spec *api.VolumeSpec, isUpdate bool, ) (*api.VolumeSpec, error) { storPolicy, err := policy.Inst() if err != nil { return nil, status.Errorf(codes.Internal, "Unable to get storage policy instance %v", err) } var policy *api.SdkStoragePolicy // check if custom pol...
go
func GetDefaultVolSpecs( ctx context.Context, spec *api.VolumeSpec, isUpdate bool, ) (*api.VolumeSpec, error) { storPolicy, err := policy.Inst() if err != nil { return nil, status.Errorf(codes.Internal, "Unable to get storage policy instance %v", err) } var policy *api.SdkStoragePolicy // check if custom pol...
[ "func", "GetDefaultVolSpecs", "(", "ctx", "context", ".", "Context", ",", "spec", "*", "api", ".", "VolumeSpec", ",", "isUpdate", "bool", ",", ")", "(", "*", "api", ".", "VolumeSpec", ",", "error", ")", "{", "storPolicy", ",", "err", ":=", "policy", "....
// GetDefaultVolSpecs returns volume spec merged with default storage policy applied if any
[ "GetDefaultVolSpecs", "returns", "volume", "spec", "merged", "with", "default", "storage", "policy", "applied", "if", "any" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/volume_ops.go#L751-L801
22,029
libopenstorage/openstorage
alerts/alerts.go
Tag
func (e Error) Tag(tag Error) Error { return Error(string(tag) + ":" + string(e)) }
go
func (e Error) Tag(tag Error) Error { return Error(string(tag) + ":" + string(e)) }
[ "func", "(", "e", "Error", ")", "Tag", "(", "tag", "Error", ")", "Error", "{", "return", "Error", "(", "string", "(", "tag", ")", "+", "\"", "\"", "+", "string", "(", "e", ")", ")", "\n", "}" ]
// Tag tags an error with a tag string. // Helpful for providing error contexts.
[ "Tag", "tags", "an", "error", "with", "a", "tag", "string", ".", "Helpful", "for", "providing", "error", "contexts", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/alerts/alerts.go#L27-L29
22,030
libopenstorage/openstorage
alerts/alerts.go
Enumerate
func (m *manager) Enumerate(filters ...Filter) ([]*api.Alert, error) { myAlerts := make([]*api.Alert, 0, 0) keys, err := getUniqueKeysFromFilters(filters...) if err != nil { return nil, err } // enumerate for unique keys for key := range keys { kvps, err := enumerate(m.kv, key) if err != nil { return ni...
go
func (m *manager) Enumerate(filters ...Filter) ([]*api.Alert, error) { myAlerts := make([]*api.Alert, 0, 0) keys, err := getUniqueKeysFromFilters(filters...) if err != nil { return nil, err } // enumerate for unique keys for key := range keys { kvps, err := enumerate(m.kv, key) if err != nil { return ni...
[ "func", "(", "m", "*", "manager", ")", "Enumerate", "(", "filters", "...", "Filter", ")", "(", "[", "]", "*", "api", ".", "Alert", ",", "error", ")", "{", "myAlerts", ":=", "make", "(", "[", "]", "*", "api", ".", "Alert", ",", "0", ",", "0", ...
// Enumerate takes a variadic list of filters that are first analyzed to see if one filter // is inclusive of other. Only the filters that are unique supersets are retained and their contents // is fetched using kvdb enumerate.
[ "Enumerate", "takes", "a", "variadic", "list", "of", "filters", "that", "are", "first", "analyzed", "to", "see", "if", "one", "filter", "is", "inclusive", "of", "other", ".", "Only", "the", "filters", "that", "are", "unique", "supersets", "are", "retained", ...
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/alerts/alerts.go#L139-L180
22,031
libopenstorage/openstorage
osdconfig/callback.go
execClusterCallbacks
func (manager *configManager) execClusterCallbacks(f CallbackClusterConfigFunc, data *data) { config := new(ClusterConfig) if err := json.Unmarshal(data.Value, config); err != nil { logrus.Error(err) return } f(config) }
go
func (manager *configManager) execClusterCallbacks(f CallbackClusterConfigFunc, data *data) { config := new(ClusterConfig) if err := json.Unmarshal(data.Value, config); err != nil { logrus.Error(err) return } f(config) }
[ "func", "(", "manager", "*", "configManager", ")", "execClusterCallbacks", "(", "f", "CallbackClusterConfigFunc", ",", "data", "*", "data", ")", "{", "config", ":=", "new", "(", "ClusterConfig", ")", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", ...
// execClusterCallbacks executes a registered cluster watcher
[ "execClusterCallbacks", "executes", "a", "registered", "cluster", "watcher" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/osdconfig/callback.go#L12-L20
22,032
libopenstorage/openstorage
osdconfig/callback.go
execNodeCallbacks
func (manager *configManager) execNodeCallbacks(f CallbackNodeConfigFunc, data *data) { config := new(NodeConfig) if err := json.Unmarshal(data.Value, config); err != nil { logrus.Error(err) return } f(config) }
go
func (manager *configManager) execNodeCallbacks(f CallbackNodeConfigFunc, data *data) { config := new(NodeConfig) if err := json.Unmarshal(data.Value, config); err != nil { logrus.Error(err) return } f(config) }
[ "func", "(", "manager", "*", "configManager", ")", "execNodeCallbacks", "(", "f", "CallbackNodeConfigFunc", ",", "data", "*", "data", ")", "{", "config", ":=", "new", "(", "NodeConfig", ")", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "data", ...
// execNodeCallbacks executes a registered node watcher
[ "execNodeCallbacks", "executes", "a", "registered", "node", "watcher" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/osdconfig/callback.go#L23-L31
22,033
libopenstorage/openstorage
osdconfig/callback.go
kvdbCallback
func (manager *configManager) kvdbCallback(prefix string, opaque interface{}, kvp *kvdb.KVPair, err error) error { manager.Lock() defer manager.Unlock() c, ok := opaque.(*dataToKvdb) if !ok { return fmt.Errorf("opaque value type is incorrect") } x := new(data) if kvp != nil { x.Key = kvp.Key x.Value = k...
go
func (manager *configManager) kvdbCallback(prefix string, opaque interface{}, kvp *kvdb.KVPair, err error) error { manager.Lock() defer manager.Unlock() c, ok := opaque.(*dataToKvdb) if !ok { return fmt.Errorf("opaque value type is incorrect") } x := new(data) if kvp != nil { x.Key = kvp.Key x.Value = k...
[ "func", "(", "manager", "*", "configManager", ")", "kvdbCallback", "(", "prefix", "string", ",", "opaque", "interface", "{", "}", ",", "kvp", "*", "kvdb", ".", "KVPair", ",", "err", "error", ")", "error", "{", "manager", ".", "Lock", "(", ")", "\n", ...
// kvdbCallback is a callback to be registered with kvdb. // this callback simply receives data from kvdb and reflects it on a channel it receives in opaque
[ "kvdbCallback", "is", "a", "callback", "to", "be", "registered", "with", "kvdb", ".", "this", "callback", "simply", "receives", "data", "from", "kvdb", "and", "reflects", "it", "on", "a", "channel", "it", "receives", "in", "opaque" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/osdconfig/callback.go#L35-L67
22,034
libopenstorage/openstorage
api/server/volume.go
create
func (vd *volAPI) create(w http.ResponseWriter, r *http.Request) { var dcRes api.VolumeCreateResponse var dcReq api.VolumeCreateRequest method := "create" if err := json.NewDecoder(r.Body).Decode(&dcReq); err != nil { fmt.Println("returning error here") vd.sendError(vd.name, method, w, err.Error(), http.Status...
go
func (vd *volAPI) create(w http.ResponseWriter, r *http.Request) { var dcRes api.VolumeCreateResponse var dcReq api.VolumeCreateRequest method := "create" if err := json.NewDecoder(r.Body).Decode(&dcReq); err != nil { fmt.Println("returning error here") vd.sendError(vd.name, method, w, err.Error(), http.Status...
[ "func", "(", "vd", "*", "volAPI", ")", "create", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "var", "dcRes", "api", ".", "VolumeCreateResponse", "\n", "var", "dcReq", "api", ".", "VolumeCreateRequest", "\n", ...
// Creates a single volume with given spec.
[ "Creates", "a", "single", "volume", "with", "given", "spec", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/volume.go#L187-L232
22,035
libopenstorage/openstorage
api/server/volume.go
GetVolumeAPIRoutes
func GetVolumeAPIRoutes(name, sdkUds string) []*Route { volMgmtApi := newVolumeAPI(name, sdkUds) return volMgmtApi.Routes() }
go
func GetVolumeAPIRoutes(name, sdkUds string) []*Route { volMgmtApi := newVolumeAPI(name, sdkUds) return volMgmtApi.Routes() }
[ "func", "GetVolumeAPIRoutes", "(", "name", ",", "sdkUds", "string", ")", "[", "]", "*", "Route", "{", "volMgmtApi", ":=", "newVolumeAPI", "(", "name", ",", "sdkUds", ")", "\n", "return", "volMgmtApi", ".", "Routes", "(", ")", "\n", "}" ]
// GetVolumeAPIRoutes returns all the volume routes. // A driver could use this function if it does not want openstorage // to setup the REST server but it sets up its own and wants to add // volume routes
[ "GetVolumeAPIRoutes", "returns", "all", "the", "volume", "routes", ".", "A", "driver", "could", "use", "this", "function", "if", "it", "does", "not", "want", "openstorage", "to", "setup", "the", "REST", "server", "but", "it", "sets", "up", "its", "own", "a...
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/volume.go#L1748-L1751
22,036
libopenstorage/openstorage
api/server/volume.go
GetVolumeAPIRoutesWithAuth
func GetVolumeAPIRoutesWithAuth( name, sdkUds string, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, router *mux.Router, serverRegisterRoute ServerRegisterRoute, preRouteCheckFn func(http.ResponseWriter, *http.Request) bool, ) (*mux.Router, error) { vd := &volAPI{ restBase: restBas...
go
func GetVolumeAPIRoutesWithAuth( name, sdkUds string, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, router *mux.Router, serverRegisterRoute ServerRegisterRoute, preRouteCheckFn func(http.ResponseWriter, *http.Request) bool, ) (*mux.Router, error) { vd := &volAPI{ restBase: restBas...
[ "func", "GetVolumeAPIRoutesWithAuth", "(", "name", ",", "sdkUds", "string", ",", "authProviderType", "secrets", ".", "AuthTokenProviders", ",", "authProvider", "osecrets", ".", "Secrets", ",", "router", "*", "mux", ".", "Router", ",", "serverRegisterRoute", "ServerR...
// GetVolumeAPIRoutesWithAuth returns a router with all the volume routes // added to the router along with the auth middleware // - preRouteCheckFn is a handler that gets executed before the actual volume handler // is invoked. It is added for legacy support where negroni middleware was not used
[ "GetVolumeAPIRoutesWithAuth", "returns", "a", "router", "with", "all", "the", "volume", "routes", "added", "to", "the", "router", "along", "with", "the", "auth", "middleware", "-", "preRouteCheckFn", "is", "a", "handler", "that", "gets", "executed", "before", "t...
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/volume.go#L1765-L1831
22,037
libopenstorage/openstorage
api/client/volume/client.go
Create
func (v *volumeClient) Create(locator *api.VolumeLocator, source *api.Source, spec *api.VolumeSpec) (string, error) { response := &api.VolumeCreateResponse{} request := &api.VolumeCreateRequest{ Locator: locator, Source: source, Spec: spec, } if err := v.c.Post().Resource(volumePath).Body(request).Do().U...
go
func (v *volumeClient) Create(locator *api.VolumeLocator, source *api.Source, spec *api.VolumeSpec) (string, error) { response := &api.VolumeCreateResponse{} request := &api.VolumeCreateRequest{ Locator: locator, Source: source, Spec: spec, } if err := v.c.Post().Resource(volumePath).Body(request).Do().U...
[ "func", "(", "v", "*", "volumeClient", ")", "Create", "(", "locator", "*", "api", ".", "VolumeLocator", ",", "source", "*", "api", ".", "Source", ",", "spec", "*", "api", ".", "VolumeSpec", ")", "(", "string", ",", "error", ")", "{", "response", ":="...
// Create a new Vol for the specific volume spev.c. // It returns a system generated VolumeID that uniquely identifies the volume
[ "Create", "a", "new", "Vol", "for", "the", "specific", "volume", "spev", ".", "c", ".", "It", "returns", "a", "system", "generated", "VolumeID", "that", "uniquely", "identifies", "the", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L125-L140
22,038
libopenstorage/openstorage
api/client/volume/client.go
Inspect
func (v *volumeClient) Inspect(ids []string) ([]*api.Volume, error) { if len(ids) == 0 { return nil, nil } var volumes []*api.Volume request := v.c.Get().Resource(volumePath) for _, id := range ids { request.QueryOption(api.OptVolumeID, id) } if err := request.Do().Unmarshal(&volumes); err != nil { return ...
go
func (v *volumeClient) Inspect(ids []string) ([]*api.Volume, error) { if len(ids) == 0 { return nil, nil } var volumes []*api.Volume request := v.c.Get().Resource(volumePath) for _, id := range ids { request.QueryOption(api.OptVolumeID, id) } if err := request.Do().Unmarshal(&volumes); err != nil { return ...
[ "func", "(", "v", "*", "volumeClient", ")", "Inspect", "(", "ids", "[", "]", "string", ")", "(", "[", "]", "*", "api", ".", "Volume", ",", "error", ")", "{", "if", "len", "(", "ids", ")", "==", "0", "{", "return", "nil", ",", "nil", "\n", "}"...
// Inspect specified volumes. // Errors ErrEnoEnt may be returned.
[ "Inspect", "specified", "volumes", ".", "Errors", "ErrEnoEnt", "may", "be", "returned", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L149-L162
22,039
libopenstorage/openstorage
api/client/volume/client.go
Snapshot
func (v *volumeClient) Snapshot(volumeID string, readonly bool, locator *api.VolumeLocator, noRetry bool, ) (string, error) { response := &api.SnapCreateResponse{} request := &api.SnapCreateRequest{ Id: volumeID, Readonly: readonly, Locator: locator, NoRetry: noRetry, } if err := v.c.Post().Resou...
go
func (v *volumeClient) Snapshot(volumeID string, readonly bool, locator *api.VolumeLocator, noRetry bool, ) (string, error) { response := &api.SnapCreateResponse{} request := &api.SnapCreateRequest{ Id: volumeID, Readonly: readonly, Locator: locator, NoRetry: noRetry, } if err := v.c.Post().Resou...
[ "func", "(", "v", "*", "volumeClient", ")", "Snapshot", "(", "volumeID", "string", ",", "readonly", "bool", ",", "locator", "*", "api", ".", "VolumeLocator", ",", "noRetry", "bool", ",", ")", "(", "string", ",", "error", ")", "{", "response", ":=", "&"...
// Snap specified volume. IO to the underlying volume should be quiesced before // calling this function. // Errors ErrEnoEnt may be returned
[ "Snap", "specified", "volume", ".", "IO", "to", "the", "underlying", "volume", "should", "be", "quiesced", "before", "calling", "this", "function", ".", "Errors", "ErrEnoEnt", "may", "be", "returned" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L180-L207
22,040
libopenstorage/openstorage
api/client/volume/client.go
Restore
func (v *volumeClient) Restore(volumeID string, snapID string) error { response := &api.VolumeResponse{} req := v.c.Post().Resource(snapPath + "/restore").Instance(volumeID) req.QueryOption(api.OptSnapID, snapID) if err := req.Do().Unmarshal(response); err != nil { return err } if response.Error != "" { retu...
go
func (v *volumeClient) Restore(volumeID string, snapID string) error { response := &api.VolumeResponse{} req := v.c.Post().Resource(snapPath + "/restore").Instance(volumeID) req.QueryOption(api.OptSnapID, snapID) if err := req.Do().Unmarshal(response); err != nil { return err } if response.Error != "" { retu...
[ "func", "(", "v", "*", "volumeClient", ")", "Restore", "(", "volumeID", "string", ",", "snapID", "string", ")", "error", "{", "response", ":=", "&", "api", ".", "VolumeResponse", "{", "}", "\n", "req", ":=", "v", ".", "c", ".", "Post", "(", ")", "....
// Restore specified volume to given snapshot state
[ "Restore", "specified", "volume", "to", "given", "snapshot", "state" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L210-L222
22,041
libopenstorage/openstorage
api/client/volume/client.go
Stats
func (v *volumeClient) Stats( volumeID string, cumulative bool, ) (*api.Stats, error) { stats := &api.Stats{} req := v.c.Get().Resource(volumePath + "/stats").Instance(volumeID) req.QueryOption(api.OptCumulative, strconv.FormatBool(cumulative)) err := req.Do().Unmarshal(stats) return stats, err }
go
func (v *volumeClient) Stats( volumeID string, cumulative bool, ) (*api.Stats, error) { stats := &api.Stats{} req := v.c.Get().Resource(volumePath + "/stats").Instance(volumeID) req.QueryOption(api.OptCumulative, strconv.FormatBool(cumulative)) err := req.Do().Unmarshal(stats) return stats, err }
[ "func", "(", "v", "*", "volumeClient", ")", "Stats", "(", "volumeID", "string", ",", "cumulative", "bool", ",", ")", "(", "*", "api", ".", "Stats", ",", "error", ")", "{", "stats", ":=", "&", "api", ".", "Stats", "{", "}", "\n", "req", ":=", "v",...
// Stats for specified volume. // Errors ErrEnoEnt may be returned
[ "Stats", "for", "specified", "volume", ".", "Errors", "ErrEnoEnt", "may", "be", "returned" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L226-L237
22,042
libopenstorage/openstorage
api/client/volume/client.go
UsedSize
func (v *volumeClient) UsedSize( volumeID string, ) (uint64, error) { var usedSize uint64 req := v.c.Get().Resource(volumePath + "/usedsize").Instance(volumeID) err := req.Do().Unmarshal(&usedSize) return usedSize, err }
go
func (v *volumeClient) UsedSize( volumeID string, ) (uint64, error) { var usedSize uint64 req := v.c.Get().Resource(volumePath + "/usedsize").Instance(volumeID) err := req.Do().Unmarshal(&usedSize) return usedSize, err }
[ "func", "(", "v", "*", "volumeClient", ")", "UsedSize", "(", "volumeID", "string", ",", ")", "(", "uint64", ",", "error", ")", "{", "var", "usedSize", "uint64", "\n", "req", ":=", "v", ".", "c", ".", "Get", "(", ")", ".", "Resource", "(", "volumePa...
// UsedSize returns allocated volume size. // Errors ErrEnoEnt may be returned
[ "UsedSize", "returns", "allocated", "volume", "size", ".", "Errors", "ErrEnoEnt", "may", "be", "returned" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L241-L248
22,043
libopenstorage/openstorage
api/client/volume/client.go
GetActiveRequests
func (v *volumeClient) GetActiveRequests() (*api.ActiveRequests, error) { requests := &api.ActiveRequests{} resp := v.c.Get().Resource(volumePath + "/requests").Instance("vol_id").Do() if resp.Error() != nil { return nil, resp.FormatError() } if err := resp.Unmarshal(requests); err != nil { return nil, err ...
go
func (v *volumeClient) GetActiveRequests() (*api.ActiveRequests, error) { requests := &api.ActiveRequests{} resp := v.c.Get().Resource(volumePath + "/requests").Instance("vol_id").Do() if resp.Error() != nil { return nil, resp.FormatError() } if err := resp.Unmarshal(requests); err != nil { return nil, err ...
[ "func", "(", "v", "*", "volumeClient", ")", "GetActiveRequests", "(", ")", "(", "*", "api", ".", "ActiveRequests", ",", "error", ")", "{", "requests", ":=", "&", "api", ".", "ActiveRequests", "{", "}", "\n", "resp", ":=", "v", ".", "c", ".", "Get", ...
// Active Requests on all volume.
[ "Active", "Requests", "on", "all", "volume", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L251-L265
22,044
libopenstorage/openstorage
api/client/volume/client.go
Enumerate
func (v *volumeClient) Enumerate(locator *api.VolumeLocator, labels map[string]string) ([]*api.Volume, error) { var volumes []*api.Volume req := v.c.Get().Resource(volumePath) if locator.Name != "" { req.QueryOption(api.OptName, locator.Name) } if len(locator.VolumeLabels) != 0 { req.QueryOptionLabel(api.OptL...
go
func (v *volumeClient) Enumerate(locator *api.VolumeLocator, labels map[string]string) ([]*api.Volume, error) { var volumes []*api.Volume req := v.c.Get().Resource(volumePath) if locator.Name != "" { req.QueryOption(api.OptName, locator.Name) } if len(locator.VolumeLabels) != 0 { req.QueryOptionLabel(api.OptL...
[ "func", "(", "v", "*", "volumeClient", ")", "Enumerate", "(", "locator", "*", "api", ".", "VolumeLocator", ",", "labels", "map", "[", "string", "]", "string", ")", "(", "[", "]", "*", "api", ".", "Volume", ",", "error", ")", "{", "var", "volumes", ...
// Enumerate volumes that map to the volumeLocator. Locator fields may be regexp. // If locator fields are left blank, this will return all volumes.
[ "Enumerate", "volumes", "that", "map", "to", "the", "volumeLocator", ".", "Locator", "fields", "may", "be", "regexp", ".", "If", "locator", "fields", "are", "left", "blank", "this", "will", "return", "all", "volumes", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L291-L313
22,045
libopenstorage/openstorage
api/client/volume/client.go
SnapEnumerate
func (v *volumeClient) SnapEnumerate(ids []string, snapLabels map[string]string) ([]*api.Volume, error) { var volumes []*api.Volume request := v.c.Get().Resource(snapPath) for _, id := range ids { request.QueryOption(api.OptVolumeID, id) } if len(snapLabels) != 0 { request.QueryOptionLabel(api.OptLabel, snapL...
go
func (v *volumeClient) SnapEnumerate(ids []string, snapLabels map[string]string) ([]*api.Volume, error) { var volumes []*api.Volume request := v.c.Get().Resource(snapPath) for _, id := range ids { request.QueryOption(api.OptVolumeID, id) } if len(snapLabels) != 0 { request.QueryOptionLabel(api.OptLabel, snapL...
[ "func", "(", "v", "*", "volumeClient", ")", "SnapEnumerate", "(", "ids", "[", "]", "string", ",", "snapLabels", "map", "[", "string", "]", "string", ")", "(", "[", "]", "*", "api", ".", "Volume", ",", "error", ")", "{", "var", "volumes", "[", "]", ...
// Enumerate snaps for specified volume // Count indicates the number of snaps populated.
[ "Enumerate", "snaps", "for", "specified", "volume", "Count", "indicates", "the", "number", "of", "snaps", "populated", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L317-L331
22,046
libopenstorage/openstorage
api/client/volume/client.go
Attach
func (v *volumeClient) Attach(volumeID string, attachOptions map[string]string) (string, error) { response, err := v.doVolumeSetGetResponse( volumeID, &api.VolumeSetRequest{ Action: &api.VolumeStateAction{ Attach: api.VolumeActionParam_VOLUME_ACTION_PARAM_ON, }, Options: attachOptions, }, ) if err...
go
func (v *volumeClient) Attach(volumeID string, attachOptions map[string]string) (string, error) { response, err := v.doVolumeSetGetResponse( volumeID, &api.VolumeSetRequest{ Action: &api.VolumeStateAction{ Attach: api.VolumeActionParam_VOLUME_ACTION_PARAM_ON, }, Options: attachOptions, }, ) if err...
[ "func", "(", "v", "*", "volumeClient", ")", "Attach", "(", "volumeID", "string", ",", "attachOptions", "map", "[", "string", "]", "string", ")", "(", "string", ",", "error", ")", "{", "response", ",", "err", ":=", "v", ".", "doVolumeSetGetResponse", "(",...
// Attach map device to the host. // On success the devicePath specifies location where the device is exported // Errors ErrEnoEnt, ErrVolAttached may be returned.
[ "Attach", "map", "device", "to", "the", "host", ".", "On", "success", "the", "devicePath", "specifies", "location", "where", "the", "device", "is", "exported", "Errors", "ErrEnoEnt", "ErrVolAttached", "may", "be", "returned", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L336-L357
22,047
libopenstorage/openstorage
api/client/volume/client.go
Detach
func (v *volumeClient) Detach(volumeID string, options map[string]string) error { return v.doVolumeSet( volumeID, &api.VolumeSetRequest{ Action: &api.VolumeStateAction{ Attach: api.VolumeActionParam_VOLUME_ACTION_PARAM_OFF, }, Options: options, }, ) }
go
func (v *volumeClient) Detach(volumeID string, options map[string]string) error { return v.doVolumeSet( volumeID, &api.VolumeSetRequest{ Action: &api.VolumeStateAction{ Attach: api.VolumeActionParam_VOLUME_ACTION_PARAM_OFF, }, Options: options, }, ) }
[ "func", "(", "v", "*", "volumeClient", ")", "Detach", "(", "volumeID", "string", ",", "options", "map", "[", "string", "]", "string", ")", "error", "{", "return", "v", ".", "doVolumeSet", "(", "volumeID", ",", "&", "api", ".", "VolumeSetRequest", "{", ...
// Detach device from the host. // Errors ErrEnoEnt, ErrVolDetached may be returned.
[ "Detach", "device", "from", "the", "host", ".", "Errors", "ErrEnoEnt", "ErrVolDetached", "may", "be", "returned", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L361-L371
22,048
libopenstorage/openstorage
api/client/volume/client.go
CredsEnumerate
func (v *volumeClient) CredsEnumerate() (map[string]interface{}, error) { creds := make(map[string]interface{}, 0) err := v.c.Get().Resource(api.OsdCredsPath).Do().Unmarshal(&creds) return creds, err }
go
func (v *volumeClient) CredsEnumerate() (map[string]interface{}, error) { creds := make(map[string]interface{}, 0) err := v.c.Get().Resource(api.OsdCredsPath).Do().Unmarshal(&creds) return creds, err }
[ "func", "(", "v", "*", "volumeClient", ")", "CredsEnumerate", "(", ")", "(", "map", "[", "string", "]", "interface", "{", "}", ",", "error", ")", "{", "creds", ":=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ",", "0", ")", "\...
// CredsEnumerate enumerates configured credentials in the cluster
[ "CredsEnumerate", "enumerates", "configured", "credentials", "in", "the", "cluster" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L470-L474
22,049
libopenstorage/openstorage
api/client/volume/client.go
CredsCreate
func (v *volumeClient) CredsCreate(params map[string]string) (string, error) { createResponse := api.CredCreateResponse{} request := &api.CredCreateRequest{ InputParams: params, } req := v.c.Post().Resource(api.OsdCredsPath).Body(request) response := req.Do() if response.Error() != nil { return "", response.F...
go
func (v *volumeClient) CredsCreate(params map[string]string) (string, error) { createResponse := api.CredCreateResponse{} request := &api.CredCreateRequest{ InputParams: params, } req := v.c.Post().Resource(api.OsdCredsPath).Body(request) response := req.Do() if response.Error() != nil { return "", response.F...
[ "func", "(", "v", "*", "volumeClient", ")", "CredsCreate", "(", "params", "map", "[", "string", "]", "string", ")", "(", "string", ",", "error", ")", "{", "createResponse", ":=", "api", ".", "CredCreateResponse", "{", "}", "\n", "request", ":=", "&", "...
// CredsCreate creates credentials for a given cloud provider
[ "CredsCreate", "creates", "credentials", "for", "a", "given", "cloud", "provider" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L477-L491
22,050
libopenstorage/openstorage
api/client/volume/client.go
CredsDelete
func (v *volumeClient) CredsDelete(uuid string) error { req := v.c.Delete().Resource(api.OsdCredsPath).Instance(uuid) response := req.Do() if response.Error() != nil { return response.FormatError() } return nil }
go
func (v *volumeClient) CredsDelete(uuid string) error { req := v.c.Delete().Resource(api.OsdCredsPath).Instance(uuid) response := req.Do() if response.Error() != nil { return response.FormatError() } return nil }
[ "func", "(", "v", "*", "volumeClient", ")", "CredsDelete", "(", "uuid", "string", ")", "error", "{", "req", ":=", "v", ".", "c", ".", "Delete", "(", ")", ".", "Resource", "(", "api", ".", "OsdCredsPath", ")", ".", "Instance", "(", "uuid", ")", "\n"...
// CredsDelete deletes the credential with given UUID
[ "CredsDelete", "deletes", "the", "credential", "with", "given", "UUID" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L494-L501
22,051
libopenstorage/openstorage
api/client/volume/client.go
CredsValidate
func (v *volumeClient) CredsValidate(uuid string) error { req := v.c.Put().Resource(api.OsdCredsPath + "/validate").Instance(uuid) response := req.Do() if response.Error() != nil { if response.StatusCode() == http.StatusUnprocessableEntity { return volume.NewCredentialError(response.Error().Error()) } retur...
go
func (v *volumeClient) CredsValidate(uuid string) error { req := v.c.Put().Resource(api.OsdCredsPath + "/validate").Instance(uuid) response := req.Do() if response.Error() != nil { if response.StatusCode() == http.StatusUnprocessableEntity { return volume.NewCredentialError(response.Error().Error()) } retur...
[ "func", "(", "v", "*", "volumeClient", ")", "CredsValidate", "(", "uuid", "string", ")", "error", "{", "req", ":=", "v", ".", "c", ".", "Put", "(", ")", ".", "Resource", "(", "api", ".", "OsdCredsPath", "+", "\"", "\"", ")", ".", "Instance", "(", ...
// CredsValidate validates the credential by accessuing the cloud // provider with the given credential
[ "CredsValidate", "validates", "the", "credential", "by", "accessuing", "the", "cloud", "provider", "with", "the", "given", "credential" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L505-L515
22,052
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupCreate
func (v *volumeClient) CloudBackupCreate( input *api.CloudBackupCreateRequest, ) (*api.CloudBackupCreateResponse, error) { createResp := &api.CloudBackupCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath).Body(input) response := req.Do() if response.Error() != nil { if response.StatusCode() == http.St...
go
func (v *volumeClient) CloudBackupCreate( input *api.CloudBackupCreateRequest, ) (*api.CloudBackupCreateResponse, error) { createResp := &api.CloudBackupCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath).Body(input) response := req.Do() if response.Error() != nil { if response.StatusCode() == http.St...
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupCreate", "(", "input", "*", "api", ".", "CloudBackupCreateRequest", ",", ")", "(", "*", "api", ".", "CloudBackupCreateResponse", ",", "error", ")", "{", "createResp", ":=", "&", "api", ".", "CloudBackup...
// CloudBackupCreate uploads snapshot of a volume to cloud
[ "CloudBackupCreate", "uploads", "snapshot", "of", "a", "volume", "to", "cloud" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L518-L537
22,053
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupGroupCreate
func (v *volumeClient) CloudBackupGroupCreate( input *api.CloudBackupGroupCreateRequest, ) (*api.CloudBackupGroupCreateResponse, error) { createResp := &api.CloudBackupGroupCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/group").Body(input) response := req.Do() if response.Error() != nil { ret...
go
func (v *volumeClient) CloudBackupGroupCreate( input *api.CloudBackupGroupCreateRequest, ) (*api.CloudBackupGroupCreateResponse, error) { createResp := &api.CloudBackupGroupCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/group").Body(input) response := req.Do() if response.Error() != nil { ret...
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupGroupCreate", "(", "input", "*", "api", ".", "CloudBackupGroupCreateRequest", ",", ")", "(", "*", "api", ".", "CloudBackupGroupCreateResponse", ",", "error", ")", "{", "createResp", ":=", "&", "api", ".",...
// CloudBackupGroupCreate uploads snapshots of a volume group to cloud
[ "CloudBackupGroupCreate", "uploads", "snapshots", "of", "a", "volume", "group", "to", "cloud" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L540-L556
22,054
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupRestore
func (v *volumeClient) CloudBackupRestore( input *api.CloudBackupRestoreRequest, ) (*api.CloudBackupRestoreResponse, error) { restoreResponse := &api.CloudBackupRestoreResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/restore").Body(input) response := req.Do() if response.Error() != nil { if response.S...
go
func (v *volumeClient) CloudBackupRestore( input *api.CloudBackupRestoreRequest, ) (*api.CloudBackupRestoreResponse, error) { restoreResponse := &api.CloudBackupRestoreResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/restore").Body(input) response := req.Do() if response.Error() != nil { if response.S...
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupRestore", "(", "input", "*", "api", ".", "CloudBackupRestoreRequest", ",", ")", "(", "*", "api", ".", "CloudBackupRestoreResponse", ",", "error", ")", "{", "restoreResponse", ":=", "&", "api", ".", "Clo...
// CloudBackupRestore downloads a cloud backup to a newly created volume
[ "CloudBackupRestore", "downloads", "a", "cloud", "backup", "to", "a", "newly", "created", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L559-L579
22,055
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupSchedCreate
func (v *volumeClient) CloudBackupSchedCreate( input *api.CloudBackupSchedCreateRequest, ) (*api.CloudBackupSchedCreateResponse, error) { createResponse := &api.CloudBackupSchedCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/sched").Body(input) response := req.Do() if response.Error() != nil { ...
go
func (v *volumeClient) CloudBackupSchedCreate( input *api.CloudBackupSchedCreateRequest, ) (*api.CloudBackupSchedCreateResponse, error) { createResponse := &api.CloudBackupSchedCreateResponse{} req := v.c.Post().Resource(api.OsdBackupPath + "/sched").Body(input) response := req.Do() if response.Error() != nil { ...
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupSchedCreate", "(", "input", "*", "api", ".", "CloudBackupSchedCreateRequest", ",", ")", "(", "*", "api", ".", "CloudBackupSchedCreateResponse", ",", "error", ")", "{", "createResponse", ":=", "&", "api", ...
// CloudBackupSchedCreate for a volume creates a schedule to backup volume to cloud
[ "CloudBackupSchedCreate", "for", "a", "volume", "creates", "a", "schedule", "to", "backup", "volume", "to", "cloud" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L687-L701
22,056
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupSchedDelete
func (v *volumeClient) CloudBackupSchedDelete( input *api.CloudBackupSchedDeleteRequest, ) error { req := v.c.Delete().Resource(api.OsdBackupPath + "/sched").Body(input) response := req.Do() if response.Error() != nil { return response.FormatError() } return nil }
go
func (v *volumeClient) CloudBackupSchedDelete( input *api.CloudBackupSchedDeleteRequest, ) error { req := v.c.Delete().Resource(api.OsdBackupPath + "/sched").Body(input) response := req.Do() if response.Error() != nil { return response.FormatError() } return nil }
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupSchedDelete", "(", "input", "*", "api", ".", "CloudBackupSchedDeleteRequest", ",", ")", "error", "{", "req", ":=", "v", ".", "c", ".", "Delete", "(", ")", ".", "Resource", "(", "api", ".", "OsdBacku...
// CloudBackupSchedDelete delete a volume's cloud backup-schedule
[ "CloudBackupSchedDelete", "delete", "a", "volume", "s", "cloud", "backup", "-", "schedule" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L722-L731
22,057
libopenstorage/openstorage
api/client/volume/client.go
CloudBackupSchedEnumerate
func (v *volumeClient) CloudBackupSchedEnumerate() (*api.CloudBackupSchedEnumerateResponse, error) { enumerateResponse := &api.CloudBackupSchedEnumerateResponse{} req := v.c.Get().Resource(api.OsdBackupPath + "/sched") response := req.Do() if response.Error() != nil { return nil, response.FormatError() } if err...
go
func (v *volumeClient) CloudBackupSchedEnumerate() (*api.CloudBackupSchedEnumerateResponse, error) { enumerateResponse := &api.CloudBackupSchedEnumerateResponse{} req := v.c.Get().Resource(api.OsdBackupPath + "/sched") response := req.Do() if response.Error() != nil { return nil, response.FormatError() } if err...
[ "func", "(", "v", "*", "volumeClient", ")", "CloudBackupSchedEnumerate", "(", ")", "(", "*", "api", ".", "CloudBackupSchedEnumerateResponse", ",", "error", ")", "{", "enumerateResponse", ":=", "&", "api", ".", "CloudBackupSchedEnumerateResponse", "{", "}", "\n", ...
// CloudBackupSchedEnumerate enumerates the configured backup-schedules in the cluster
[ "CloudBackupSchedEnumerate", "enumerates", "the", "configured", "backup", "-", "schedules", "in", "the", "cluster" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/volume/client.go#L734-L745
22,058
libopenstorage/openstorage
pkg/auth/systemtoken/systemtoken.go
NewManager
func NewManager(cfg *Config) (auth.TokenGenerator, error) { if cfg == nil || len(cfg.ClusterId) == 0 || len(cfg.NodeId) == 0 || len(cfg.SharedSecret) == 0 { return nil, fmt.Errorf("Must supply claims, clusterUuid, nodeId, and system secret") } claims := &auth.Claims{ Issuer: cfg.ClusterId, Subject: cfg...
go
func NewManager(cfg *Config) (auth.TokenGenerator, error) { if cfg == nil || len(cfg.ClusterId) == 0 || len(cfg.NodeId) == 0 || len(cfg.SharedSecret) == 0 { return nil, fmt.Errorf("Must supply claims, clusterUuid, nodeId, and system secret") } claims := &auth.Claims{ Issuer: cfg.ClusterId, Subject: cfg...
[ "func", "NewManager", "(", "cfg", "*", "Config", ")", "(", "auth", ".", "TokenGenerator", ",", "error", ")", "{", "if", "cfg", "==", "nil", "||", "len", "(", "cfg", ".", "ClusterId", ")", "==", "0", "||", "len", "(", "cfg", ".", "NodeId", ")", "=...
// NewManager initializes the system token generator
[ "NewManager", "initializes", "the", "system", "token", "generator" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/systemtoken/systemtoken.go#L27-L48
22,059
libopenstorage/openstorage
pkg/auth/systemtoken/systemtoken.go
GetAuthenticator
func (m *manager) GetAuthenticator() (auth.Authenticator, error) { return auth.NewJwtAuth(&auth.JwtAuthConfig{ SharedSecret: []byte(m.config.SharedSecret), }) }
go
func (m *manager) GetAuthenticator() (auth.Authenticator, error) { return auth.NewJwtAuth(&auth.JwtAuthConfig{ SharedSecret: []byte(m.config.SharedSecret), }) }
[ "func", "(", "m", "*", "manager", ")", "GetAuthenticator", "(", ")", "(", "auth", ".", "Authenticator", ",", "error", ")", "{", "return", "auth", ".", "NewJwtAuth", "(", "&", "auth", ".", "JwtAuthConfig", "{", "SharedSecret", ":", "[", "]", "byte", "("...
// GetAuthenticator returns an authenticator for this issuer used by the SDK
[ "GetAuthenticator", "returns", "an", "authenticator", "for", "this", "issuer", "used", "by", "the", "SDK" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/systemtoken/systemtoken.go#L57-L61
22,060
libopenstorage/openstorage
pkg/auth/systemtoken/systemtoken.go
GetToken
func (m *manager) GetToken(opts *auth.Options) (string, error) { signature, err := auth.NewSignatureSharedSecret(m.config.SharedSecret) if err != nil { return "", err } return auth.Token(m.claims, signature, opts) }
go
func (m *manager) GetToken(opts *auth.Options) (string, error) { signature, err := auth.NewSignatureSharedSecret(m.config.SharedSecret) if err != nil { return "", err } return auth.Token(m.claims, signature, opts) }
[ "func", "(", "m", "*", "manager", ")", "GetToken", "(", "opts", "*", "auth", ".", "Options", ")", "(", "string", ",", "error", ")", "{", "signature", ",", "err", ":=", "auth", ".", "NewSignatureSharedSecret", "(", "m", ".", "config", ".", "SharedSecret...
// GetToken returns a token which can be used for // authentication and communication from node to node.
[ "GetToken", "returns", "a", "token", "which", "can", "be", "used", "for", "authentication", "and", "communication", "from", "node", "to", "node", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/systemtoken/systemtoken.go#L65-L72
22,061
libopenstorage/openstorage
api/server/sdk/rest_gateway.go
restServerSetupHandlers
func (s *sdkRestGateway) restServerSetupHandlers() (http.Handler, error) { // Create an HTTP server router mux := http.NewServeMux() // Swagger files using packr swaggerUIBox := packr.NewBox("./swagger-ui") swaggerJSONBox := packr.NewBox("./api") mime.AddExtensionType(".svg", "image/svg+xml") // Handler to re...
go
func (s *sdkRestGateway) restServerSetupHandlers() (http.Handler, error) { // Create an HTTP server router mux := http.NewServeMux() // Swagger files using packr swaggerUIBox := packr.NewBox("./swagger-ui") swaggerJSONBox := packr.NewBox("./api") mime.AddExtensionType(".svg", "image/svg+xml") // Handler to re...
[ "func", "(", "s", "*", "sdkRestGateway", ")", "restServerSetupHandlers", "(", ")", "(", "http", ".", "Handler", ",", "error", ")", "{", "// Create an HTTP server router", "mux", ":=", "http", ".", "NewServeMux", "(", ")", "\n\n", "// Swagger files using packr", ...
// restServerSetupHandlers sets up the handlers to the swagger ui and // to the gRPC REST Gateway.
[ "restServerSetupHandlers", "sets", "up", "the", "handlers", "to", "the", "swagger", "ui", "and", "to", "the", "gRPC", "REST", "Gateway", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/rest_gateway.go#L94-L169
22,062
libopenstorage/openstorage
pkg/seed/git.go
Load
func (g *Git) Load(dest string) error { g.ready = false cmd := exec.Command("git", "clone", g.host, dest) if output, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("'wd: %s git clone %s': %s: %s", dest, g.host, output, err) } if len(g.revision) == 0 { g.ready = true return nil } cmd = exec.C...
go
func (g *Git) Load(dest string) error { g.ready = false cmd := exec.Command("git", "clone", g.host, dest) if output, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("'wd: %s git clone %s': %s: %s", dest, g.host, output, err) } if len(g.revision) == 0 { g.ready = true return nil } cmd = exec.C...
[ "func", "(", "g", "*", "Git", ")", "Load", "(", "dest", "string", ")", "error", "{", "g", ".", "ready", "=", "false", "\n", "cmd", ":=", "exec", ".", "Command", "(", "\"", "\"", ",", "\"", "\"", ",", "g", ".", "host", ",", "dest", ")", "\n\n"...
// Load from URI into dest.
[ "Load", "from", "URI", "into", "dest", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/seed/git.go#L24-L49
22,063
libopenstorage/openstorage
volume/drivers/buse/nbd.go
Create
func Create(device Device, id string, size int64) *NBD { if shuttingDown { logrus.Warnf("Cannot create NBD device during shutdown") return nil } if size >= 0 { globalMutex.Lock() defer globalMutex.Unlock() dev := &NBD{device: device, devicePath: "", size: size, deviceFile: nil, socket: ...
go
func Create(device Device, id string, size int64) *NBD { if shuttingDown { logrus.Warnf("Cannot create NBD device during shutdown") return nil } if size >= 0 { globalMutex.Lock() defer globalMutex.Unlock() dev := &NBD{device: device, devicePath: "", size: size, deviceFile: nil, socket: ...
[ "func", "Create", "(", "device", "Device", ",", "id", "string", ",", "size", "int64", ")", "*", "NBD", "{", "if", "shuttingDown", "{", "logrus", ".", "Warnf", "(", "\"", "\"", ")", "\n", "return", "nil", "\n", "}", "\n\n", "if", "size", ">=", "0", ...
// Create creates a NBD type interface
[ "Create", "creates", "a", "NBD", "type", "interface" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/buse/nbd.go#L102-L125
22,064
libopenstorage/openstorage
volume/drivers/buse/nbd.go
Size
func (nbd *NBD) Size(size int64) (err error) { if err = ioctl(nbd.deviceFile.Fd(), NBD_SET_BLKSIZE, 4096); err != nil { err = &os.PathError{ Op: nbd.deviceFile.Name(), Path: "ioctl NBD_SET_BLKSIZE", Err: err, } } else if err = ioctl(nbd.deviceFile.Fd(), NBD_SET_SIZE_BLOCKS, uintptr(size/4096)); err !=...
go
func (nbd *NBD) Size(size int64) (err error) { if err = ioctl(nbd.deviceFile.Fd(), NBD_SET_BLKSIZE, 4096); err != nil { err = &os.PathError{ Op: nbd.deviceFile.Name(), Path: "ioctl NBD_SET_BLKSIZE", Err: err, } } else if err = ioctl(nbd.deviceFile.Fd(), NBD_SET_SIZE_BLOCKS, uintptr(size/4096)); err !=...
[ "func", "(", "nbd", "*", "NBD", ")", "Size", "(", "size", "int64", ")", "(", "err", "error", ")", "{", "if", "err", "=", "ioctl", "(", "nbd", ".", "deviceFile", ".", "Fd", "(", ")", ",", "NBD_SET_BLKSIZE", ",", "4096", ")", ";", "err", "!=", "n...
// Size sets the size of the NBD.
[ "Size", "sets", "the", "size", "of", "the", "NBD", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/buse/nbd.go#L138-L154
22,065
libopenstorage/openstorage
volume/drivers/buse/nbd.go
Connect
func (nbd *NBD) Connect() (dev string, err error) { pair, err := syscall.Socketpair(syscall.SOCK_STREAM, syscall.AF_UNIX, 0) if err != nil { return "", err } // Find free NBD device. for i := 0; ; i++ { dev = fmt.Sprintf("/dev/nbd%d", i) if _, err = os.Stat(dev); os.IsNotExist(err) { dev = "" return "...
go
func (nbd *NBD) Connect() (dev string, err error) { pair, err := syscall.Socketpair(syscall.SOCK_STREAM, syscall.AF_UNIX, 0) if err != nil { return "", err } // Find free NBD device. for i := 0; ; i++ { dev = fmt.Sprintf("/dev/nbd%d", i) if _, err = os.Stat(dev); os.IsNotExist(err) { dev = "" return "...
[ "func", "(", "nbd", "*", "NBD", ")", "Connect", "(", ")", "(", "dev", "string", ",", "err", "error", ")", "{", "pair", ",", "err", ":=", "syscall", ".", "Socketpair", "(", "syscall", ".", "SOCK_STREAM", ",", "syscall", ".", "AF_UNIX", ",", "0", ")"...
// Connect the network block device.
[ "Connect", "the", "network", "block", "device", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/buse/nbd.go#L157-L202
22,066
libopenstorage/openstorage
volume/drivers/buse/nbd.go
Disconnect
func (nbd *NBD) Disconnect() { nbd.mutex.Lock() defer nbd.mutex.Unlock() logrus.Infof("Disconnecting device %v...", nbd.devicePath) syscall.Unmount(nbd.devicePath, 0) if nbd.IsConnected() { logrus.Infof("Issuing a disconnect on %v", nbd.devicePath) ioctl(nbd.deviceFile.Fd(), NBD_DISCONNECT, 0) logrus.Infof...
go
func (nbd *NBD) Disconnect() { nbd.mutex.Lock() defer nbd.mutex.Unlock() logrus.Infof("Disconnecting device %v...", nbd.devicePath) syscall.Unmount(nbd.devicePath, 0) if nbd.IsConnected() { logrus.Infof("Issuing a disconnect on %v", nbd.devicePath) ioctl(nbd.deviceFile.Fd(), NBD_DISCONNECT, 0) logrus.Infof...
[ "func", "(", "nbd", "*", "NBD", ")", "Disconnect", "(", ")", "{", "nbd", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "nbd", ".", "mutex", ".", "Unlock", "(", ")", "\n\n", "logrus", ".", "Infof", "(", "\"", "\"", ",", "nbd", ".", "device...
// Disconnect disconnects the network block device
[ "Disconnect", "disconnects", "the", "network", "block", "device" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/buse/nbd.go#L205-L231
22,067
libopenstorage/openstorage
pkg/auth/oidc.go
NewOIDC
func NewOIDC(config *OIDCAuthConfig) (*OIDCAuthenticator, error) { p, err := oidc.NewProvider(context.Background(), config.Issuer) if err != nil { return nil, fmt.Errorf("Unable to communicate with OIDC provider %s: %v", config.Issuer, err) } v := p.Verifier(&oidc.Config{ ClientID: config.Client...
go
func NewOIDC(config *OIDCAuthConfig) (*OIDCAuthenticator, error) { p, err := oidc.NewProvider(context.Background(), config.Issuer) if err != nil { return nil, fmt.Errorf("Unable to communicate with OIDC provider %s: %v", config.Issuer, err) } v := p.Verifier(&oidc.Config{ ClientID: config.Client...
[ "func", "NewOIDC", "(", "config", "*", "OIDCAuthConfig", ")", "(", "*", "OIDCAuthenticator", ",", "error", ")", "{", "p", ",", "err", ":=", "oidc", ".", "NewProvider", "(", "context", ".", "Background", "(", ")", ",", "config", ".", "Issuer", ")", "\n"...
// NewOIDC returns a new OIDC authenticator
[ "NewOIDC", "returns", "a", "new", "OIDC", "authenticator" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/oidc.go#L55-L74
22,068
libopenstorage/openstorage
pkg/auth/oidc.go
AuthenticateToken
func (o *OIDCAuthenticator) AuthenticateToken(ctx context.Context, rawtoken string) (*Claims, error) { idToken, err := o.verifier.Verify(ctx, rawtoken) if err != nil { return nil, fmt.Errorf("Token failed validation: %v", err) } // Check for required claims var claims map[string]interface{} if err := idToken.C...
go
func (o *OIDCAuthenticator) AuthenticateToken(ctx context.Context, rawtoken string) (*Claims, error) { idToken, err := o.verifier.Verify(ctx, rawtoken) if err != nil { return nil, fmt.Errorf("Token failed validation: %v", err) } // Check for required claims var claims map[string]interface{} if err := idToken.C...
[ "func", "(", "o", "*", "OIDCAuthenticator", ")", "AuthenticateToken", "(", "ctx", "context", ".", "Context", ",", "rawtoken", "string", ")", "(", "*", "Claims", ",", "error", ")", "{", "idToken", ",", "err", ":=", "o", ".", "verifier", ".", "Verify", "...
// AuthenticateToken will verify the validity of the provided token with the OIDC
[ "AuthenticateToken", "will", "verify", "the", "validity", "of", "the", "provided", "token", "with", "the", "OIDC" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/oidc.go#L77-L96
22,069
libopenstorage/openstorage
pkg/auth/oidc.go
Username
func (o *OIDCAuthenticator) Username(claims *Claims) string { return getUsername(o.usernameClaim, claims) }
go
func (o *OIDCAuthenticator) Username(claims *Claims) string { return getUsername(o.usernameClaim, claims) }
[ "func", "(", "o", "*", "OIDCAuthenticator", ")", "Username", "(", "claims", "*", "Claims", ")", "string", "{", "return", "getUsername", "(", "o", ".", "usernameClaim", ",", "claims", ")", "\n", "}" ]
// Username returns the configured unique id of the user
[ "Username", "returns", "the", "configured", "unique", "id", "of", "the", "user" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/oidc.go#L99-L101
22,070
libopenstorage/openstorage
pkg/auth/oidc.go
parseClaims
func (o *OIDCAuthenticator) parseClaims(claims map[string]interface{}) (*Claims, error) { // If we have namespace set, then use it to get custom claims: if len(o.namespace) > 0 { for _, cc := range customClaims { // Check if there claims needed are under a namespace if v, ok := claims[o.namespace+cc]; ok { ...
go
func (o *OIDCAuthenticator) parseClaims(claims map[string]interface{}) (*Claims, error) { // If we have namespace set, then use it to get custom claims: if len(o.namespace) > 0 { for _, cc := range customClaims { // Check if there claims needed are under a namespace if v, ok := claims[o.namespace+cc]; ok { ...
[ "func", "(", "o", "*", "OIDCAuthenticator", ")", "parseClaims", "(", "claims", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "*", "Claims", ",", "error", ")", "{", "// If we have namespace set, then use it to get custom claims:", "if", "len", "(", ...
// This will let us unit test this function without having a real OIDC
[ "This", "will", "let", "us", "unit", "test", "this", "function", "without", "having", "a", "real", "OIDC" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/oidc.go#L104-L135
22,071
libopenstorage/openstorage
pkg/storageops/utils.go
AddElementToMap
func AddElementToMap( sets map[string][]interface{}, elem interface{}, key string, ) { if s, ok := sets[key]; ok { sets[key] = append(s, elem) } else { sets[key] = make([]interface{}, 0) sets[key] = append(sets[key], elem) } }
go
func AddElementToMap( sets map[string][]interface{}, elem interface{}, key string, ) { if s, ok := sets[key]; ok { sets[key] = append(s, elem) } else { sets[key] = make([]interface{}, 0) sets[key] = append(sets[key], elem) } }
[ "func", "AddElementToMap", "(", "sets", "map", "[", "string", "]", "[", "]", "interface", "{", "}", ",", "elem", "interface", "{", "}", ",", "key", "string", ",", ")", "{", "if", "s", ",", "ok", ":=", "sets", "[", "key", "]", ";", "ok", "{", "s...
// AddElementToMap adds to the given 'elem' to the 'sets' map with given 'key'
[ "AddElementToMap", "adds", "to", "the", "given", "elem", "to", "the", "sets", "map", "with", "given", "key" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/utils.go#L20-L31
22,072
libopenstorage/openstorage
pkg/storageops/utils.go
GetEnvValueStrict
func GetEnvValueStrict(key string) (string, error) { if val := os.Getenv(key); len(val) != 0 { return strings.TrimSpace(val), nil } return "", fmt.Errorf("env variable %s is not set", key) }
go
func GetEnvValueStrict(key string) (string, error) { if val := os.Getenv(key); len(val) != 0 { return strings.TrimSpace(val), nil } return "", fmt.Errorf("env variable %s is not set", key) }
[ "func", "GetEnvValueStrict", "(", "key", "string", ")", "(", "string", ",", "error", ")", "{", "if", "val", ":=", "os", ".", "Getenv", "(", "key", ")", ";", "len", "(", "val", ")", "!=", "0", "{", "return", "strings", ".", "TrimSpace", "(", "val", ...
// GetEnvValueStrict fetches value for env variable "key". Returns error if not found or empty
[ "GetEnvValueStrict", "fetches", "value", "for", "env", "variable", "key", ".", "Returns", "error", "if", "not", "found", "or", "empty" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/utils.go#L34-L40
22,073
libopenstorage/openstorage
alerts/action.go
clearActionFunc
func clearActionFunc(manager Manager, filters ...Filter) error { myAlerts, err := manager.Enumerate(filters...) if err != nil { return err } for _, myAlert := range myAlerts { myAlert.Cleared = true if err := manager.Raise(myAlert); err != nil { return err } } return nil }
go
func clearActionFunc(manager Manager, filters ...Filter) error { myAlerts, err := manager.Enumerate(filters...) if err != nil { return err } for _, myAlert := range myAlerts { myAlert.Cleared = true if err := manager.Raise(myAlert); err != nil { return err } } return nil }
[ "func", "clearActionFunc", "(", "manager", "Manager", ",", "filters", "...", "Filter", ")", "error", "{", "myAlerts", ",", "err", ":=", "manager", ".", "Enumerate", "(", "filters", "...", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", ...
// clearActionFunc first enumerates, then changes Cleared flag to true, // then updates it. // Raise method determines if ttlOption needs to be applied based on clear flag.
[ "clearActionFunc", "first", "enumerates", "then", "changes", "Cleared", "flag", "to", "true", "then", "updates", "it", ".", "Raise", "method", "determines", "if", "ttlOption", "needs", "to", "be", "applied", "based", "on", "clear", "flag", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/alerts/action.go#L39-L53
22,074
libopenstorage/openstorage
pkg/auth/selfsigned.go
NewJwtAuth
func NewJwtAuth(config *JwtAuthConfig) (*JwtAuthenticator, error) { if config == nil { return nil, fmt.Errorf("Must provide configuration") } // Check at least one is set if len(config.SharedSecret) == 0 && len(config.RsaPublicPem) == 0 && len(config.ECDSPublicPem) == 0 { return nil, fmt.Errorf("Server wa...
go
func NewJwtAuth(config *JwtAuthConfig) (*JwtAuthenticator, error) { if config == nil { return nil, fmt.Errorf("Must provide configuration") } // Check at least one is set if len(config.SharedSecret) == 0 && len(config.RsaPublicPem) == 0 && len(config.ECDSPublicPem) == 0 { return nil, fmt.Errorf("Server wa...
[ "func", "NewJwtAuth", "(", "config", "*", "JwtAuthConfig", ")", "(", "*", "JwtAuthenticator", ",", "error", ")", "{", "if", "config", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Check at le...
// New returns a JwtAuthenticator
[ "New", "returns", "a", "JwtAuthenticator" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/selfsigned.go#L51-L87
22,075
libopenstorage/openstorage
pkg/auth/selfsigned.go
AuthenticateToken
func (j *JwtAuthenticator) AuthenticateToken(ctx context.Context, rawtoken string) (*Claims, error) { // Parse token token, err := jwt.Parse(rawtoken, func(token *jwt.Token) (interface{}, error) { // Verify Method if strings.HasPrefix(token.Method.Alg(), "RS") { // RS256, RS384, or RS512 return j.rsaKey, ...
go
func (j *JwtAuthenticator) AuthenticateToken(ctx context.Context, rawtoken string) (*Claims, error) { // Parse token token, err := jwt.Parse(rawtoken, func(token *jwt.Token) (interface{}, error) { // Verify Method if strings.HasPrefix(token.Method.Alg(), "RS") { // RS256, RS384, or RS512 return j.rsaKey, ...
[ "func", "(", "j", "*", "JwtAuthenticator", ")", "AuthenticateToken", "(", "ctx", "context", ".", "Context", ",", "rawtoken", "string", ")", "(", "*", "Claims", ",", "error", ")", "{", "// Parse token", "token", ",", "err", ":=", "jwt", ".", "Parse", "(",...
// AuthenticateToken determines if a token is valid and if it is, returns // the information in the claims.
[ "AuthenticateToken", "determines", "if", "a", "token", "is", "valid", "and", "if", "it", "is", "returns", "the", "information", "in", "the", "claims", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/selfsigned.go#L91-L150
22,076
libopenstorage/openstorage
volume/drivers/coprhd/coprhd.go
getAuthSession
func (d *driver) getAuthSession() (session *napping.Session, err error) { e := ApiError{} s := napping.Session{ Userinfo: d.creds, Client: d.httpClient, } url := d.url + loginUri resp, err := s.Get(url, nil, nil, &e) if err != nil { return } token := resp.HttpResponse().Header.Get("X-SDS-AUTH-TOKEN...
go
func (d *driver) getAuthSession() (session *napping.Session, err error) { e := ApiError{} s := napping.Session{ Userinfo: d.creds, Client: d.httpClient, } url := d.url + loginUri resp, err := s.Get(url, nil, nil, &e) if err != nil { return } token := resp.HttpResponse().Header.Get("X-SDS-AUTH-TOKEN...
[ "func", "(", "d", "*", "driver", ")", "getAuthSession", "(", ")", "(", "session", "*", "napping", ".", "Session", ",", "err", "error", ")", "{", "e", ":=", "ApiError", "{", "}", "\n\n", "s", ":=", "napping", ".", "Session", "{", "Userinfo", ":", "d...
// getAuthSession returns an authenticated API Session
[ "getAuthSession", "returns", "an", "authenticated", "API", "Session" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/coprhd/coprhd.go#L253-L281
22,077
libopenstorage/openstorage
pkg/grpcserver/grpcutil.go
Connect
func Connect(address string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error) { u, err := url.Parse(address) if err == nil && (!u.IsAbs() || u.Scheme == "unix") { dialOptions = append(dialOptions, grpc.WithDialer( func(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeou...
go
func Connect(address string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error) { u, err := url.Parse(address) if err == nil && (!u.IsAbs() || u.Scheme == "unix") { dialOptions = append(dialOptions, grpc.WithDialer( func(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeou...
[ "func", "Connect", "(", "address", "string", ",", "dialOptions", "[", "]", "grpc", ".", "DialOption", ")", "(", "*", "grpc", ".", "ClientConn", ",", "error", ")", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "address", ")", "\n", "if", "er...
// Connect address by grpc
[ "Connect", "address", "by", "grpc" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/grpcserver/grpcutil.go#L33-L61
22,078
libopenstorage/openstorage
csi/v0.3/node.go
NodeGetId
func (s *OsdCsiServer) NodeGetId( ctx context.Context, req *csi.NodeGetIdRequest, ) (*csi.NodeGetIdResponse, error) { clus, err := s.cluster.Enumerate() if err != nil { return nil, status.Errorf(codes.Internal, "Unable to Enumerate cluster: %s", err) } result := &csi.NodeGetIdResponse{ NodeId: clus.NodeId, ...
go
func (s *OsdCsiServer) NodeGetId( ctx context.Context, req *csi.NodeGetIdRequest, ) (*csi.NodeGetIdResponse, error) { clus, err := s.cluster.Enumerate() if err != nil { return nil, status.Errorf(codes.Internal, "Unable to Enumerate cluster: %s", err) } result := &csi.NodeGetIdResponse{ NodeId: clus.NodeId, ...
[ "func", "(", "s", "*", "OsdCsiServer", ")", "NodeGetId", "(", "ctx", "context", ".", "Context", ",", "req", "*", "csi", ".", "NodeGetIdRequest", ",", ")", "(", "*", "csi", ".", "NodeGetIdResponse", ",", "error", ")", "{", "clus", ",", "err", ":=", "s...
// NodeGetId is a CSI API which gets the PX NodeId for the local node
[ "NodeGetId", "is", "a", "CSI", "API", "which", "gets", "the", "PX", "NodeId", "for", "the", "local", "node" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/node.go#L52-L68
22,079
libopenstorage/openstorage
csi/v0.3/node.go
NodeUnpublishVolume
func (s *OsdCsiServer) NodeUnpublishVolume( ctx context.Context, req *csi.NodeUnpublishVolumeRequest, ) (*csi.NodeUnpublishVolumeResponse, error) { logrus.Debugf("NodeUnPublishVolume req[%#v]", req) // Check arguments if len(req.GetVolumeId()) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume id m...
go
func (s *OsdCsiServer) NodeUnpublishVolume( ctx context.Context, req *csi.NodeUnpublishVolumeRequest, ) (*csi.NodeUnpublishVolumeResponse, error) { logrus.Debugf("NodeUnPublishVolume req[%#v]", req) // Check arguments if len(req.GetVolumeId()) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume id m...
[ "func", "(", "s", "*", "OsdCsiServer", ")", "NodeUnpublishVolume", "(", "ctx", "context", ".", "Context", ",", "req", "*", "csi", ".", "NodeUnpublishVolumeRequest", ",", ")", "(", "*", "csi", ".", "NodeUnpublishVolumeResponse", ",", "error", ")", "{", "logru...
// NodeUnpublishVolume is a CSI API call which unmounts the volume.
[ "NodeUnpublishVolume", "is", "a", "CSI", "API", "call", "which", "unmounts", "the", "volume", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/node.go#L184-L258
22,080
libopenstorage/openstorage
csi/v0.3/node.go
NodeGetCapabilities
func (s *OsdCsiServer) NodeGetCapabilities( ctx context.Context, req *csi.NodeGetCapabilitiesRequest, ) (*csi.NodeGetCapabilitiesResponse, error) { logrus.Debugf("NodeGetCapabilities req[%#v]", req) return &csi.NodeGetCapabilitiesResponse{ Capabilities: []*csi.NodeServiceCapability{ { Type: &csi.NodeServ...
go
func (s *OsdCsiServer) NodeGetCapabilities( ctx context.Context, req *csi.NodeGetCapabilitiesRequest, ) (*csi.NodeGetCapabilitiesResponse, error) { logrus.Debugf("NodeGetCapabilities req[%#v]", req) return &csi.NodeGetCapabilitiesResponse{ Capabilities: []*csi.NodeServiceCapability{ { Type: &csi.NodeServ...
[ "func", "(", "s", "*", "OsdCsiServer", ")", "NodeGetCapabilities", "(", "ctx", "context", ".", "Context", ",", "req", "*", "csi", ".", "NodeGetCapabilitiesRequest", ",", ")", "(", "*", "csi", ".", "NodeGetCapabilitiesResponse", ",", "error", ")", "{", "logru...
// NodeGetCapabilities is a CSI API function which seems to be setup for // future patches
[ "NodeGetCapabilities", "is", "a", "CSI", "API", "function", "which", "seems", "to", "be", "setup", "for", "future", "patches" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/node.go#L262-L280
22,081
libopenstorage/openstorage
api/server/server.go
StartGraphAPI
func StartGraphAPI(name string, restBase string) error { graphPlugin := newGraphPlugin(name) if _, _, err := startServer(name, restBase, 0, graphPlugin); err != nil { return err } return nil }
go
func StartGraphAPI(name string, restBase string) error { graphPlugin := newGraphPlugin(name) if _, _, err := startServer(name, restBase, 0, graphPlugin); err != nil { return err } return nil }
[ "func", "StartGraphAPI", "(", "name", "string", ",", "restBase", "string", ")", "error", "{", "graphPlugin", ":=", "newGraphPlugin", "(", "name", ")", "\n", "if", "_", ",", "_", ",", "err", ":=", "startServer", "(", "name", ",", "restBase", ",", "0", "...
// StartGraphAPI starts a REST server to receive GraphDriver commands from // the Linux container engine.
[ "StartGraphAPI", "starts", "a", "REST", "server", "to", "receive", "GraphDriver", "commands", "from", "the", "Linux", "container", "engine", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/server.go#L54-L61
22,082
libopenstorage/openstorage
api/server/server.go
StartVolumeMgmtAPI
func StartVolumeMgmtAPI( name, sdkUds string, mgmtBase string, mgmtPort uint16, auth bool, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, ) (*http.Server, *http.Server, error) { var ( unixServer, portServer *http.Server err error ) volMgmtApi := newVolumeAPI(...
go
func StartVolumeMgmtAPI( name, sdkUds string, mgmtBase string, mgmtPort uint16, auth bool, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, ) (*http.Server, *http.Server, error) { var ( unixServer, portServer *http.Server err error ) volMgmtApi := newVolumeAPI(...
[ "func", "StartVolumeMgmtAPI", "(", "name", ",", "sdkUds", "string", ",", "mgmtBase", "string", ",", "mgmtPort", "uint16", ",", "auth", "bool", ",", "authProviderType", "secrets", ".", "AuthTokenProviders", ",", "authProvider", "osecrets", ".", "Secrets", ",", ")...
// StartVolumeMgmtAPI starts a REST server to receive volume management API commands
[ "StartVolumeMgmtAPI", "starts", "a", "REST", "server", "to", "receive", "volume", "management", "API", "commands" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/server.go#L64-L97
22,083
libopenstorage/openstorage
api/server/server.go
StartVolumePluginAPI
func StartVolumePluginAPI( name, sdkUds string, pluginBase string, pluginPort uint16, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, ) error { var secretsStore secrets.Auth var err error // Only initialize secrets store if we have a valid auth provider. if authProvider != nil && a...
go
func StartVolumePluginAPI( name, sdkUds string, pluginBase string, pluginPort uint16, authProviderType secrets.AuthTokenProviders, authProvider osecrets.Secrets, ) error { var secretsStore secrets.Auth var err error // Only initialize secrets store if we have a valid auth provider. if authProvider != nil && a...
[ "func", "StartVolumePluginAPI", "(", "name", ",", "sdkUds", "string", ",", "pluginBase", "string", ",", "pluginPort", "uint16", ",", "authProviderType", "secrets", ".", "AuthTokenProviders", ",", "authProvider", "osecrets", ".", "Secrets", ",", ")", "error", "{", ...
// StartVolumePluginAPI starts a REST server to receive volume API commands // from the linux container engine
[ "StartVolumePluginAPI", "starts", "a", "REST", "server", "to", "receive", "volume", "API", "commands", "from", "the", "linux", "container", "engine" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/server.go#L101-L129
22,084
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
NewSdkRoleManager
func NewSdkRoleManager(kv kvdb.Kvdb) (*SdkRoleManager, error) { s := &SdkRoleManager{ kv: kv, } // Load all default roles for k, v := range defaultRoles { role := &api.SdkRole{ Name: k, Rules: v, } if _, err := kv.Put(prefixWithName(k), role, 0); err != nil { return nil, err } } return s, ni...
go
func NewSdkRoleManager(kv kvdb.Kvdb) (*SdkRoleManager, error) { s := &SdkRoleManager{ kv: kv, } // Load all default roles for k, v := range defaultRoles { role := &api.SdkRole{ Name: k, Rules: v, } if _, err := kv.Put(prefixWithName(k), role, 0); err != nil { return nil, err } } return s, ni...
[ "func", "NewSdkRoleManager", "(", "kv", "kvdb", ".", "Kvdb", ")", "(", "*", "SdkRoleManager", ",", "error", ")", "{", "s", ":=", "&", "SdkRoleManager", "{", "kv", ":", "kv", ",", "}", "\n\n", "// Load all default roles", "for", "k", ",", "v", ":=", "ra...
// NewSdkRoleManager returns a new SDK role manager
[ "NewSdkRoleManager", "returns", "a", "new", "SDK", "role", "manager" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L152-L169
22,085
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Create
func (r *SdkRoleManager) Create( ctx context.Context, req *api.SdkRoleCreateRequest, ) (*api.SdkRoleCreateResponse, error) { if req.GetRole() == nil { return nil, status.Error(codes.InvalidArgument, "Must supply a role") } else if len(req.GetRole().GetName()) == 0 { return nil, status.Error(codes.InvalidArgumen...
go
func (r *SdkRoleManager) Create( ctx context.Context, req *api.SdkRoleCreateRequest, ) (*api.SdkRoleCreateResponse, error) { if req.GetRole() == nil { return nil, status.Error(codes.InvalidArgument, "Must supply a role") } else if len(req.GetRole().GetName()) == 0 { return nil, status.Error(codes.InvalidArgumen...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkRoleCreateRequest", ",", ")", "(", "*", "api", ".", "SdkRoleCreateResponse", ",", "error", ")", "{", "if", "req", ".", "GetR...
// Create saves a role in Kvdb
[ "Create", "saves", "a", "role", "in", "Kvdb" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L172-L214
22,086
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Enumerate
func (r *SdkRoleManager) Enumerate( ctx context.Context, req *api.SdkRoleEnumerateRequest, ) (*api.SdkRoleEnumerateResponse, error) { keys, err := r.kv.Keys(rolePrefix, "/") if err != nil { return nil, status.Errorf(codes.Internal, "Failed to access roles from database: %v", err) } names := make([]string, len(...
go
func (r *SdkRoleManager) Enumerate( ctx context.Context, req *api.SdkRoleEnumerateRequest, ) (*api.SdkRoleEnumerateResponse, error) { keys, err := r.kv.Keys(rolePrefix, "/") if err != nil { return nil, status.Errorf(codes.Internal, "Failed to access roles from database: %v", err) } names := make([]string, len(...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Enumerate", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkRoleEnumerateRequest", ",", ")", "(", "*", "api", ".", "SdkRoleEnumerateResponse", ",", "error", ")", "{", "keys", ",", "er...
// Enumerate returns a list of role names
[ "Enumerate", "returns", "a", "list", "of", "role", "names" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L217-L234
22,087
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Inspect
func (r *SdkRoleManager) Inspect( ctx context.Context, req *api.SdkRoleInspectRequest, ) (*api.SdkRoleInspectResponse, error) { if len(req.GetName()) == 0 { return nil, status.Error(codes.InvalidArgument, "Must supply a name for role") } elem := &api.SdkRole{} _, err := r.kv.GetVal(prefixWithName(req.GetName()...
go
func (r *SdkRoleManager) Inspect( ctx context.Context, req *api.SdkRoleInspectRequest, ) (*api.SdkRoleInspectResponse, error) { if len(req.GetName()) == 0 { return nil, status.Error(codes.InvalidArgument, "Must supply a name for role") } elem := &api.SdkRole{} _, err := r.kv.GetVal(prefixWithName(req.GetName()...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Inspect", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkRoleInspectRequest", ",", ")", "(", "*", "api", ".", "SdkRoleInspectResponse", ",", "error", ")", "{", "if", "len", "(", "r...
// Inspect returns a role object
[ "Inspect", "returns", "a", "role", "object" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L237-L256
22,088
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Delete
func (r *SdkRoleManager) Delete( ctx context.Context, req *api.SdkRoleDeleteRequest, ) (*api.SdkRoleDeleteResponse, error) { if len(req.GetName()) == 0 { return nil, status.Error(codes.InvalidArgument, "Must supply a name for role") } // Determine if there is collision with default roles if _, ok := defaultRol...
go
func (r *SdkRoleManager) Delete( ctx context.Context, req *api.SdkRoleDeleteRequest, ) (*api.SdkRoleDeleteResponse, error) { if len(req.GetName()) == 0 { return nil, status.Error(codes.InvalidArgument, "Must supply a name for role") } // Determine if there is collision with default roles if _, ok := defaultRol...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkRoleDeleteRequest", ",", ")", "(", "*", "api", ".", "SdkRoleDeleteResponse", ",", "error", ")", "{", "if", "len", "(", "req"...
// Delete removes a role from Kvdb
[ "Delete", "removes", "a", "role", "from", "Kvdb" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L259-L280
22,089
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Update
func (r *SdkRoleManager) Update( ctx context.Context, req *api.SdkRoleUpdateRequest, ) (*api.SdkRoleUpdateResponse, error) { if req.GetRole() == nil { return nil, status.Error(codes.InvalidArgument, "Must supply a role") } if err := r.validateRole(req.GetRole()); err != nil { return nil, err } // Determine ...
go
func (r *SdkRoleManager) Update( ctx context.Context, req *api.SdkRoleUpdateRequest, ) (*api.SdkRoleUpdateResponse, error) { if req.GetRole() == nil { return nil, status.Error(codes.InvalidArgument, "Must supply a role") } if err := r.validateRole(req.GetRole()); err != nil { return nil, err } // Determine ...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkRoleUpdateRequest", ",", ")", "(", "*", "api", ".", "SdkRoleUpdateResponse", ",", "error", ")", "{", "if", "req", ".", "GetR...
// Update replaces an existing role.
[ "Update", "replaces", "an", "existing", "role", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L283-L311
22,090
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
Verify
func (r *SdkRoleManager) Verify(ctx context.Context, roles []string, fullmethod string) error { // Check all roles for _, role := range roles { // Get the role rules resp, err := r.Inspect(ctx, &api.SdkRoleInspectRequest{ Name: role, }) if err != nil || resp == nil || resp.GetRole() == nil { continue ...
go
func (r *SdkRoleManager) Verify(ctx context.Context, roles []string, fullmethod string) error { // Check all roles for _, role := range roles { // Get the role rules resp, err := r.Inspect(ctx, &api.SdkRoleInspectRequest{ Name: role, }) if err != nil || resp == nil || resp.GetRole() == nil { continue ...
[ "func", "(", "r", "*", "SdkRoleManager", ")", "Verify", "(", "ctx", "context", ".", "Context", ",", "roles", "[", "]", "string", ",", "fullmethod", "string", ")", "error", "{", "// Check all roles", "for", "_", ",", "role", ":=", "range", "roles", "{", ...
// Verify determines if the role has access to `fullmethod`
[ "Verify", "determines", "if", "the", "role", "has", "access", "to", "fullmethod" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L314-L332
22,091
libopenstorage/openstorage
pkg/role/sdkserviceapi.go
verifyRules
func (r *SdkRoleManager) verifyRules(rules []*api.SdkRule, fullmethod string) error { var reqService, reqApi string // String: "/openstorage.api.OpenStorage<service>/<method>" parts := strings.Split(fullmethod, "/") if len(parts) > 1 { reqService = strings.TrimPrefix(strings.ToLower(parts[1]), "openstorage.api....
go
func (r *SdkRoleManager) verifyRules(rules []*api.SdkRule, fullmethod string) error { var reqService, reqApi string // String: "/openstorage.api.OpenStorage<service>/<method>" parts := strings.Split(fullmethod, "/") if len(parts) > 1 { reqService = strings.TrimPrefix(strings.ToLower(parts[1]), "openstorage.api....
[ "func", "(", "r", "*", "SdkRoleManager", ")", "verifyRules", "(", "rules", "[", "]", "*", "api", ".", "SdkRule", ",", "fullmethod", "string", ")", "error", "{", "var", "reqService", ",", "reqApi", "string", "\n\n", "// String: \"/openstorage.api.OpenStorage<serv...
// verifyRules checks if the rules authorize use of the API called `fullmethod`
[ "verifyRules", "checks", "if", "the", "rules", "authorize", "use", "of", "the", "API", "called", "fullmethod" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/role/sdkserviceapi.go#L335-L363
22,092
libopenstorage/openstorage
pkg/seed/seed.go
New
func New(uri string, options map[string]string) (Source, error) { u, err := url.Parse(uri) if err != nil { return nil, err } switch u.Scheme { case "github": return NewGitSource(uri, options) } return nil, ErrUnsupported }
go
func New(uri string, options map[string]string) (Source, error) { u, err := url.Parse(uri) if err != nil { return nil, err } switch u.Scheme { case "github": return NewGitSource(uri, options) } return nil, ErrUnsupported }
[ "func", "New", "(", "uri", "string", ",", "options", "map", "[", "string", "]", "string", ")", "(", "Source", ",", "error", ")", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "uri", ")", "\n", "if", "err", "!=", "nil", "{", "return", "n...
// New returns a new instance of Source
[ "New", "returns", "a", "new", "instance", "of", "Source" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/seed/seed.go#L26-L36
22,093
libopenstorage/openstorage
api/server/sdk/objectstore.go
Inspect
func (s *ObjectstoreServer) Inspect( ctx context.Context, req *api.SdkObjectstoreInspectRequest, ) (*api.SdkObjectstoreInspectResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } objResp, err := s.cluster().ObjectStoreInspect(req.GetObject...
go
func (s *ObjectstoreServer) Inspect( ctx context.Context, req *api.SdkObjectstoreInspectRequest, ) (*api.SdkObjectstoreInspectResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } objResp, err := s.cluster().ObjectStoreInspect(req.GetObject...
[ "func", "(", "s", "*", "ObjectstoreServer", ")", "Inspect", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkObjectstoreInspectRequest", ",", ")", "(", "*", "api", ".", "SdkObjectstoreInspectResponse", ",", "error", ")", "{", "if", "...
// Inspect Objectstore return status of provided objectstore
[ "Inspect", "Objectstore", "return", "status", "of", "provided", "objectstore" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/objectstore.go#L40-L63
22,094
libopenstorage/openstorage
api/server/sdk/objectstore.go
Create
func (s *ObjectstoreServer) Create( ctx context.Context, req *api.SdkObjectstoreCreateRequest, ) (*api.SdkObjectstoreCreateResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status.Error(cod...
go
func (s *ObjectstoreServer) Create( ctx context.Context, req *api.SdkObjectstoreCreateRequest, ) (*api.SdkObjectstoreCreateResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } if len(req.GetVolumeId()) == 0 { return nil, status.Error(cod...
[ "func", "(", "s", "*", "ObjectstoreServer", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkObjectstoreCreateRequest", ",", ")", "(", "*", "api", ".", "SdkObjectstoreCreateResponse", ",", "error", ")", "{", "if", "s",...
// CreateObjectstore creates objectstore for given volume
[ "CreateObjectstore", "creates", "objectstore", "for", "given", "volume" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/objectstore.go#L66-L86
22,095
libopenstorage/openstorage
api/server/sdk/objectstore.go
Update
func (s *ObjectstoreServer) Update( ctx context.Context, req *api.SdkObjectstoreUpdateRequest, ) (*api.SdkObjectstoreUpdateResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } err := s.cluster().ObjectStoreUpdate(req.GetObjectstoreId(), re...
go
func (s *ObjectstoreServer) Update( ctx context.Context, req *api.SdkObjectstoreUpdateRequest, ) (*api.SdkObjectstoreUpdateResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } err := s.cluster().ObjectStoreUpdate(req.GetObjectstoreId(), re...
[ "func", "(", "s", "*", "ObjectstoreServer", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkObjectstoreUpdateRequest", ",", ")", "(", "*", "api", ".", "SdkObjectstoreUpdateResponse", ",", "error", ")", "{", "if", "s",...
// UpdateObjectstore updates given objectstore state
[ "UpdateObjectstore", "updates", "given", "objectstore", "state" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/objectstore.go#L89-L112
22,096
libopenstorage/openstorage
api/server/sdk/objectstore.go
Delete
func (s *ObjectstoreServer) Delete( ctx context.Context, req *api.SdkObjectstoreDeleteRequest, ) (*api.SdkObjectstoreDeleteResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } err := s.cluster().ObjectStoreDelete(req.GetObjectstoreId()) i...
go
func (s *ObjectstoreServer) Delete( ctx context.Context, req *api.SdkObjectstoreDeleteRequest, ) (*api.SdkObjectstoreDeleteResponse, error) { if s.cluster() == nil { return nil, status.Error(codes.Unavailable, "Resource has not been initialized") } err := s.cluster().ObjectStoreDelete(req.GetObjectstoreId()) i...
[ "func", "(", "s", "*", "ObjectstoreServer", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "req", "*", "api", ".", "SdkObjectstoreDeleteRequest", ",", ")", "(", "*", "api", ".", "SdkObjectstoreDeleteResponse", ",", "error", ")", "{", "if", "s",...
// DeleteObjectstore delete objectstore from cluster
[ "DeleteObjectstore", "delete", "objectstore", "from", "cluster" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/objectstore.go#L115-L132
22,097
libopenstorage/openstorage
csi/csi.go
NewOsdCsiServer
func NewOsdCsiServer(config *OsdCsiServerConfig) (grpcserver.Server, error) { if nil == config { return nil, fmt.Errorf("Must supply configuration") } if len(config.SdkUds) == 0 { return nil, fmt.Errorf("SdkUds must be provided") } if len(config.DriverName) == 0 { return nil, fmt.Errorf("OSD Driver name must...
go
func NewOsdCsiServer(config *OsdCsiServerConfig) (grpcserver.Server, error) { if nil == config { return nil, fmt.Errorf("Must supply configuration") } if len(config.SdkUds) == 0 { return nil, fmt.Errorf("SdkUds must be provided") } if len(config.DriverName) == 0 { return nil, fmt.Errorf("OSD Driver name must...
[ "func", "NewOsdCsiServer", "(", "config", "*", "OsdCsiServerConfig", ")", "(", "grpcserver", ".", "Server", ",", "error", ")", "{", "if", "nil", "==", "config", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "...
// NewOsdCsiServer creates a gRPC CSI complient server on the // specified port and transport.
[ "NewOsdCsiServer", "creates", "a", "gRPC", "CSI", "complient", "server", "on", "the", "specified", "port", "and", "transport", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/csi.go#L64-L97
22,098
libopenstorage/openstorage
csi/csi.go
setupContextWithToken
func (s *OsdCsiServer) setupContextWithToken(ctx context.Context, csiSecrets map[string]string) context.Context { if token, ok := csiSecrets[authsecrets.SecretTokenKey]; ok { md := metadata.New(map[string]string{ "authorization": "bearer " + token, }) return metadata.NewOutgoingContext(ctx, md) } return ctx...
go
func (s *OsdCsiServer) setupContextWithToken(ctx context.Context, csiSecrets map[string]string) context.Context { if token, ok := csiSecrets[authsecrets.SecretTokenKey]; ok { md := metadata.New(map[string]string{ "authorization": "bearer " + token, }) return metadata.NewOutgoingContext(ctx, md) } return ctx...
[ "func", "(", "s", "*", "OsdCsiServer", ")", "setupContextWithToken", "(", "ctx", "context", ".", "Context", ",", "csiSecrets", "map", "[", "string", "]", "string", ")", "context", ".", "Context", "{", "if", "token", ",", "ok", ":=", "csiSecrets", "[", "a...
// Gets token from the secrets. In Kubernetes, the side car containers copy // the contents of a K8S Secret map into the Secrets section of the CSI call.
[ "Gets", "token", "from", "the", "secrets", ".", "In", "Kubernetes", "the", "side", "car", "containers", "copy", "the", "contents", "of", "a", "K8S", "Secret", "map", "into", "the", "Secrets", "section", "of", "the", "CSI", "call", "." ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/csi.go#L117-L125
22,099
libopenstorage/openstorage
pkg/storageops/storageops.go
NewStorageError
func NewStorageError(code int, msg string, instance string) error { return &StorageError{Code: code, Msg: msg, Instance: instance} }
go
func NewStorageError(code int, msg string, instance string) error { return &StorageError{Code: code, Msg: msg, Instance: instance} }
[ "func", "NewStorageError", "(", "code", "int", ",", "msg", "string", ",", "instance", "string", ")", "error", "{", "return", "&", "StorageError", "{", "Code", ":", "code", ",", "Msg", ":", "msg", ",", "Instance", ":", "instance", "}", "\n", "}" ]
// NewStorageError creates a new custom storage error instance
[ "NewStorageError", "creates", "a", "new", "custom", "storage", "error", "instance" ]
71b7f37f99c70e697aa31ca57fa8fb1404629329
https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/storageops.go#L93-L95