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
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
21,500
vmware/govmomi
vapi/tags/categories.go
CreateCategory
func (c *Manager) CreateCategory(ctx context.Context, category *Category) (string, error) { // create avoids the annoyance of CreateTag requiring field keys to be included in the request, // even though the field value can be empty. type create struct { Name string `json:"name"` Description stri...
go
func (c *Manager) CreateCategory(ctx context.Context, category *Category) (string, error) { // create avoids the annoyance of CreateTag requiring field keys to be included in the request, // even though the field value can be empty. type create struct { Name string `json:"name"` Description stri...
[ "func", "(", "c", "*", "Manager", ")", "CreateCategory", "(", "ctx", "context", ".", "Context", ",", "category", "*", "Category", ")", "(", "string", ",", "error", ")", "{", "// create avoids the annoyance of CreateTag requiring field keys to be included in the request,...
// CreateCategory creates a new category and returns the category ID.
[ "CreateCategory", "creates", "a", "new", "category", "and", "returns", "the", "category", "ID", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L67-L93
21,501
vmware/govmomi
vapi/tags/categories.go
UpdateCategory
func (c *Manager) UpdateCategory(ctx context.Context, category *Category) error { spec := struct { Category Category `json:"update_spec"` }{ Category: Category{ AssociableTypes: category.AssociableTypes, Cardinality: category.Cardinality, Description: category.Description, Name: cat...
go
func (c *Manager) UpdateCategory(ctx context.Context, category *Category) error { spec := struct { Category Category `json:"update_spec"` }{ Category: Category{ AssociableTypes: category.AssociableTypes, Cardinality: category.Cardinality, Description: category.Description, Name: cat...
[ "func", "(", "c", "*", "Manager", ")", "UpdateCategory", "(", "ctx", "context", ".", "Context", ",", "category", "*", "Category", ")", "error", "{", "spec", ":=", "struct", "{", "Category", "Category", "`json:\"update_spec\"`", "\n", "}", "{", "Category", ...
// UpdateCategory can update one or more of the AssociableTypes, Cardinality, Description and Name fields.
[ "UpdateCategory", "can", "update", "one", "or", "more", "of", "the", "AssociableTypes", "Cardinality", "Description", "and", "Name", "fields", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L96-L109
21,502
vmware/govmomi
vapi/tags/categories.go
DeleteCategory
func (c *Manager) DeleteCategory(ctx context.Context, category *Category) error { url := internal.URL(c, internal.CategoryPath).WithID(category.ID) return c.Do(ctx, url.Request(http.MethodDelete), nil) }
go
func (c *Manager) DeleteCategory(ctx context.Context, category *Category) error { url := internal.URL(c, internal.CategoryPath).WithID(category.ID) return c.Do(ctx, url.Request(http.MethodDelete), nil) }
[ "func", "(", "c", "*", "Manager", ")", "DeleteCategory", "(", "ctx", "context", ".", "Context", ",", "category", "*", "Category", ")", "error", "{", "url", ":=", "internal", ".", "URL", "(", "c", ",", "internal", ".", "CategoryPath", ")", ".", "WithID"...
// DeleteCategory deletes an existing category.
[ "DeleteCategory", "deletes", "an", "existing", "category", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L112-L115
21,503
vmware/govmomi
vapi/tags/categories.go
GetCategory
func (c *Manager) GetCategory(ctx context.Context, id string) (*Category, error) { if isName(id) { cat, err := c.GetCategories(ctx) if err != nil { return nil, err } for i := range cat { if cat[i].Name == id { return &cat[i], nil } } } url := internal.URL(c, internal.CategoryPath).WithID(id) ...
go
func (c *Manager) GetCategory(ctx context.Context, id string) (*Category, error) { if isName(id) { cat, err := c.GetCategories(ctx) if err != nil { return nil, err } for i := range cat { if cat[i].Name == id { return &cat[i], nil } } } url := internal.URL(c, internal.CategoryPath).WithID(id) ...
[ "func", "(", "c", "*", "Manager", ")", "GetCategory", "(", "ctx", "context", ".", "Context", ",", "id", "string", ")", "(", "*", "Category", ",", "error", ")", "{", "if", "isName", "(", "id", ")", "{", "cat", ",", "err", ":=", "c", ".", "GetCateg...
// GetCategory fetches the category information for the given identifier. // The id parameter can be a Category ID or Category Name.
[ "GetCategory", "fetches", "the", "category", "information", "for", "the", "given", "identifier", ".", "The", "id", "parameter", "can", "be", "a", "Category", "ID", "or", "Category", "Name", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L119-L135
21,504
vmware/govmomi
vapi/tags/categories.go
ListCategories
func (c *Manager) ListCategories(ctx context.Context) ([]string, error) { url := internal.URL(c, internal.CategoryPath) var res []string return res, c.Do(ctx, url.Request(http.MethodGet), &res) }
go
func (c *Manager) ListCategories(ctx context.Context) ([]string, error) { url := internal.URL(c, internal.CategoryPath) var res []string return res, c.Do(ctx, url.Request(http.MethodGet), &res) }
[ "func", "(", "c", "*", "Manager", ")", "ListCategories", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "string", ",", "error", ")", "{", "url", ":=", "internal", ".", "URL", "(", "c", ",", "internal", ".", "CategoryPath", ")", "\n", "v...
// ListCategories returns all category IDs in the system.
[ "ListCategories", "returns", "all", "category", "IDs", "in", "the", "system", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L138-L142
21,505
vmware/govmomi
vapi/tags/categories.go
GetCategories
func (c *Manager) GetCategories(ctx context.Context) ([]Category, error) { ids, err := c.ListCategories(ctx) if err != nil { return nil, fmt.Errorf("list categories: %s", err) } var categories []Category for _, id := range ids { category, err := c.GetCategory(ctx, id) if err != nil { return nil, fmt.Erro...
go
func (c *Manager) GetCategories(ctx context.Context) ([]Category, error) { ids, err := c.ListCategories(ctx) if err != nil { return nil, fmt.Errorf("list categories: %s", err) } var categories []Category for _, id := range ids { category, err := c.GetCategory(ctx, id) if err != nil { return nil, fmt.Erro...
[ "func", "(", "c", "*", "Manager", ")", "GetCategories", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "Category", ",", "error", ")", "{", "ids", ",", "err", ":=", "c", ".", "ListCategories", "(", "ctx", ")", "\n", "if", "err", "!=", ...
// GetCategories fetches an array of category information in the system.
[ "GetCategories", "fetches", "an", "array", "of", "category", "information", "in", "the", "system", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/tags/categories.go#L145-L162
21,506
vmware/govmomi
vapi/simulator/simulator.go
New
func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { s := &handler{ ServeMux: http.NewServeMux(), URL: *u, Category: make(map[string]*tags.Category), Tag: make(map[string]*tags.Tag), Association: make(map[string]map[internal.AssociatedObject]bool), Session: ...
go
func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { s := &handler{ ServeMux: http.NewServeMux(), URL: *u, Category: make(map[string]*tags.Category), Tag: make(map[string]*tags.Tag), Association: make(map[string]map[internal.AssociatedObject]bool), Session: ...
[ "func", "New", "(", "u", "*", "url", ".", "URL", ",", "settings", "[", "]", "vim", ".", "BaseOptionValue", ")", "(", "string", ",", "http", ".", "Handler", ")", "{", "s", ":=", "&", "handler", "{", "ServeMux", ":", "http", ".", "NewServeMux", "(", ...
// New creates a vAPI simulator.
[ "New", "creates", "a", "vAPI", "simulator", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L85-L140
21,507
vmware/govmomi
vapi/simulator/simulator.go
AttachedObjects
func (s *handler) AttachedObjects(tag vim.VslmTagEntry) ([]vim.ManagedObjectReference, vim.BaseMethodFault) { t := s.findTag(tag) if t == nil { return nil, new(vim.NotFound) } var ids []vim.ManagedObjectReference for id := range s.Association[t.ID] { ids = append(ids, vim.ManagedObjectReference(id)) } return...
go
func (s *handler) AttachedObjects(tag vim.VslmTagEntry) ([]vim.ManagedObjectReference, vim.BaseMethodFault) { t := s.findTag(tag) if t == nil { return nil, new(vim.NotFound) } var ids []vim.ManagedObjectReference for id := range s.Association[t.ID] { ids = append(ids, vim.ManagedObjectReference(id)) } return...
[ "func", "(", "s", "*", "handler", ")", "AttachedObjects", "(", "tag", "vim", ".", "VslmTagEntry", ")", "(", "[", "]", "vim", ".", "ManagedObjectReference", ",", "vim", ".", "BaseMethodFault", ")", "{", "t", ":=", "s", ".", "findTag", "(", "tag", ")", ...
// AttachedObjects is meant for internal use via simulator.Registry.tagManager
[ "AttachedObjects", "is", "meant", "for", "internal", "use", "via", "simulator", ".", "Registry", ".", "tagManager" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L188-L198
21,508
vmware/govmomi
vapi/simulator/simulator.go
AttachedTags
func (s *handler) AttachedTags(ref vim.ManagedObjectReference) ([]vim.VslmTagEntry, vim.BaseMethodFault) { oid := internal.AssociatedObject(ref) var tags []vim.VslmTagEntry for id, objs := range s.Association { if objs[oid] { tag := s.Tag[id] cat := s.Category[tag.CategoryID] tags = append(tags, vim.VslmT...
go
func (s *handler) AttachedTags(ref vim.ManagedObjectReference) ([]vim.VslmTagEntry, vim.BaseMethodFault) { oid := internal.AssociatedObject(ref) var tags []vim.VslmTagEntry for id, objs := range s.Association { if objs[oid] { tag := s.Tag[id] cat := s.Category[tag.CategoryID] tags = append(tags, vim.VslmT...
[ "func", "(", "s", "*", "handler", ")", "AttachedTags", "(", "ref", "vim", ".", "ManagedObjectReference", ")", "(", "[", "]", "vim", ".", "VslmTagEntry", ",", "vim", ".", "BaseMethodFault", ")", "{", "oid", ":=", "internal", ".", "AssociatedObject", "(", ...
// AttachedTags is meant for internal use via simulator.Registry.tagManager
[ "AttachedTags", "is", "meant", "for", "internal", "use", "via", "simulator", ".", "Registry", ".", "tagManager" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L201-L215
21,509
vmware/govmomi
vapi/simulator/simulator.go
AttachTag
func (s *handler) AttachTag(ref vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { t := s.findTag(tag) if t == nil { return new(vim.NotFound) } s.Association[t.ID][internal.AssociatedObject(ref)] = true return nil }
go
func (s *handler) AttachTag(ref vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { t := s.findTag(tag) if t == nil { return new(vim.NotFound) } s.Association[t.ID][internal.AssociatedObject(ref)] = true return nil }
[ "func", "(", "s", "*", "handler", ")", "AttachTag", "(", "ref", "vim", ".", "ManagedObjectReference", ",", "tag", "vim", ".", "VslmTagEntry", ")", "vim", ".", "BaseMethodFault", "{", "t", ":=", "s", ".", "findTag", "(", "tag", ")", "\n", "if", "t", "...
// AttachTag is meant for internal use via simulator.Registry.tagManager
[ "AttachTag", "is", "meant", "for", "internal", "use", "via", "simulator", ".", "Registry", ".", "tagManager" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L218-L225
21,510
vmware/govmomi
vapi/simulator/simulator.go
DetachTag
func (s *handler) DetachTag(id vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { t := s.findTag(tag) if t == nil { return new(vim.NotFound) } delete(s.Association[t.ID], internal.AssociatedObject(id)) return nil }
go
func (s *handler) DetachTag(id vim.ManagedObjectReference, tag vim.VslmTagEntry) vim.BaseMethodFault { t := s.findTag(tag) if t == nil { return new(vim.NotFound) } delete(s.Association[t.ID], internal.AssociatedObject(id)) return nil }
[ "func", "(", "s", "*", "handler", ")", "DetachTag", "(", "id", "vim", ".", "ManagedObjectReference", ",", "tag", "vim", ".", "VslmTagEntry", ")", "vim", ".", "BaseMethodFault", "{", "t", ":=", "s", ".", "findTag", "(", "tag", ")", "\n", "if", "t", "=...
// DetachTag is meant for internal use via simulator.Registry.tagManager
[ "DetachTag", "is", "meant", "for", "internal", "use", "via", "simulator", ".", "Registry", ".", "tagManager" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L228-L235
21,511
vmware/govmomi
vapi/simulator/simulator.go
ok
func (s *handler) ok(w http.ResponseWriter, val ...interface{}) { w.WriteHeader(http.StatusOK) if len(val) == 0 { return } err := json.NewEncoder(w).Encode(struct { Value interface{} `json:"value,omitempty"` }{ val[0], }) if err != nil { log.Panic(err) } }
go
func (s *handler) ok(w http.ResponseWriter, val ...interface{}) { w.WriteHeader(http.StatusOK) if len(val) == 0 { return } err := json.NewEncoder(w).Encode(struct { Value interface{} `json:"value,omitempty"` }{ val[0], }) if err != nil { log.Panic(err) } }
[ "func", "(", "s", "*", "handler", ")", "ok", "(", "w", "http", ".", "ResponseWriter", ",", "val", "...", "interface", "{", "}", ")", "{", "w", ".", "WriteHeader", "(", "http", ".", "StatusOK", ")", "\n\n", "if", "len", "(", "val", ")", "==", "0",...
// ok responds with http.StatusOK and json encodes val if given.
[ "ok", "responds", "with", "http", ".", "StatusOK", "and", "json", "encodes", "val", "if", "given", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L238-L254
21,512
vmware/govmomi
vapi/simulator/simulator.go
ServeHTTP
func (s *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodPost, http.MethodDelete, http.MethodGet, http.MethodPatch, http.MethodPut: default: w.WriteHeader(http.StatusMethodNotAllowed) return } h, _ := s.Handler(r) h.ServeHTTP(w, r) }
go
func (s *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodPost, http.MethodDelete, http.MethodGet, http.MethodPatch, http.MethodPut: default: w.WriteHeader(http.StatusMethodNotAllowed) return } h, _ := s.Handler(r) h.ServeHTTP(w, r) }
[ "func", "(", "s", "*", "handler", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "switch", "r", ".", "Method", "{", "case", "http", ".", "MethodPost", ",", "http", ".", "MethodDelete", ",",...
// ServeHTTP handles vAPI requests.
[ "ServeHTTP", "handles", "vAPI", "requests", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L279-L289
21,513
vmware/govmomi
vapi/simulator/simulator.go
libraryPath
func libraryPath(l *library.Library, id string) string { // DatastoreID (moref) format is "$local-path@$ds-folder-id", // see simulator.HostDatastoreSystem.CreateLocalDatastore ds := strings.SplitN(l.Storage[0].DatastoreID, "@", 2)[0] return path.Join(append([]string{ds, "contentlib-" + l.ID}, id)...) }
go
func libraryPath(l *library.Library, id string) string { // DatastoreID (moref) format is "$local-path@$ds-folder-id", // see simulator.HostDatastoreSystem.CreateLocalDatastore ds := strings.SplitN(l.Storage[0].DatastoreID, "@", 2)[0] return path.Join(append([]string{ds, "contentlib-" + l.ID}, id)...) }
[ "func", "libraryPath", "(", "l", "*", "library", ".", "Library", ",", "id", "string", ")", "string", "{", "// DatastoreID (moref) format is \"$local-path@$ds-folder-id\",", "// see simulator.HostDatastoreSystem.CreateLocalDatastore", "ds", ":=", "strings", ".", "SplitN", "(...
// libraryPath returns the local Datastore fs path for a Library or Item if id is specified.
[ "libraryPath", "returns", "the", "local", "Datastore", "fs", "path", "for", "a", "Library", "or", "Item", "if", "id", "is", "specified", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/simulator/simulator.go#L898-L903
21,514
vmware/govmomi
govc/library/ova.go
NewOVAFile
func NewOVAFile(filename string) (*OVAFile, error) { f, err := os.Open(filename) if err != nil { return nil, err } tarFile := tar.NewReader(f) return &OVAFile{filename: filename, file: f, tarFile: tarFile}, nil }
go
func NewOVAFile(filename string) (*OVAFile, error) { f, err := os.Open(filename) if err != nil { return nil, err } tarFile := tar.NewReader(f) return &OVAFile{filename: filename, file: f, tarFile: tarFile}, nil }
[ "func", "NewOVAFile", "(", "filename", "string", ")", "(", "*", "OVAFile", ",", "error", ")", "{", "f", ",", "err", ":=", "os", ".", "Open", "(", "filename", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", ...
// NewOVAFile creates a new OVA file reader
[ "NewOVAFile", "creates", "a", "new", "OVA", "file", "reader" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/library/ova.go#L87-L94
21,515
vmware/govmomi
govc/library/ova.go
Find
func (of *OVAFile) Find(filename string) (*tar.Header, error) { for { header, err := of.tarFile.Next() if err == io.EOF { return nil, err } if header.Name == filename { return header, nil } } }
go
func (of *OVAFile) Find(filename string) (*tar.Header, error) { for { header, err := of.tarFile.Next() if err == io.EOF { return nil, err } if header.Name == filename { return header, nil } } }
[ "func", "(", "of", "*", "OVAFile", ")", "Find", "(", "filename", "string", ")", "(", "*", "tar", ".", "Header", ",", "error", ")", "{", "for", "{", "header", ",", "err", ":=", "of", ".", "tarFile", ".", "Next", "(", ")", "\n", "if", "err", "=="...
// Find looks for a filename match in the OVA file
[ "Find", "looks", "for", "a", "filename", "match", "in", "the", "OVA", "file" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/library/ova.go#L97-L107
21,516
vmware/govmomi
govc/library/ova.go
Read
func (of *OVAFile) Read(b []byte) (int, error) { if of.tarFile == nil { return 0, io.EOF } return of.tarFile.Read(b) }
go
func (of *OVAFile) Read(b []byte) (int, error) { if of.tarFile == nil { return 0, io.EOF } return of.tarFile.Read(b) }
[ "func", "(", "of", "*", "OVAFile", ")", "Read", "(", "b", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "if", "of", ".", "tarFile", "==", "nil", "{", "return", "0", ",", "io", ".", "EOF", "\n", "}", "\n", "return", "of", ".", "...
// Read reads from the current file in the OVA file
[ "Read", "reads", "from", "the", "current", "file", "in", "the", "OVA", "file" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/library/ova.go#L115-L120
21,517
vmware/govmomi
govc/library/ova.go
getOVAFileInfo
func getOVAFileInfo(ovafile string, filename string) (int64, string, error) { of, err := NewOVAFile(ovafile) if err != nil { return 0, "", err } hdr, err := of.Find(filename) if err != nil { return 0, "", err } hash := md5.New() _, err = io.Copy(hash, of) if err != nil { return 0, "", err } md5String...
go
func getOVAFileInfo(ovafile string, filename string) (int64, string, error) { of, err := NewOVAFile(ovafile) if err != nil { return 0, "", err } hdr, err := of.Find(filename) if err != nil { return 0, "", err } hash := md5.New() _, err = io.Copy(hash, of) if err != nil { return 0, "", err } md5String...
[ "func", "getOVAFileInfo", "(", "ovafile", "string", ",", "filename", "string", ")", "(", "int64", ",", "string", ",", "error", ")", "{", "of", ",", "err", ":=", "NewOVAFile", "(", "ovafile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",...
// getOVAFileInfo opens an OVA, finds the file entry, and returns both the size and md5 checksum
[ "getOVAFileInfo", "opens", "an", "OVA", "finds", "the", "file", "entry", "and", "returns", "both", "the", "size", "and", "md5", "checksum" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/library/ova.go#L128-L147
21,518
vmware/govmomi
govc/library/ova.go
uploadFile
func uploadFile(ctx context.Context, m *library.Manager, sessionID string, ovafile string, filename string) error { var updateFileInfo library.UpdateFile fmt.Printf("Uploading %s from %s\n", filename, ovafile) size, md5String, _ := getOVAFileInfo(ovafile, filename) // Get the URI for the file upload updateFileI...
go
func uploadFile(ctx context.Context, m *library.Manager, sessionID string, ovafile string, filename string) error { var updateFileInfo library.UpdateFile fmt.Printf("Uploading %s from %s\n", filename, ovafile) size, md5String, _ := getOVAFileInfo(ovafile, filename) // Get the URI for the file upload updateFileI...
[ "func", "uploadFile", "(", "ctx", "context", ".", "Context", ",", "m", "*", "library", ".", "Manager", ",", "sessionID", "string", ",", "ovafile", "string", ",", "filename", "string", ")", "error", "{", "var", "updateFileInfo", "library", ".", "UpdateFile", ...
// uploadFile will upload a single file from an OVA using the sessionID provided
[ "uploadFile", "will", "upload", "a", "single", "file", "from", "an", "OVA", "using", "the", "sessionID", "provided" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/library/ova.go#L150-L190
21,519
vmware/govmomi
simulator/folder.go
hostsWithDatastore
func hostsWithDatastore(hosts []types.ManagedObjectReference, path string) []types.ManagedObjectReference { attached := hosts[:0] var p object.DatastorePath p.FromString(path) for _, host := range hosts { h := Map.Get(host).(*HostSystem) if Map.FindByName(p.Datastore, h.Datastore) != nil { attached = append...
go
func hostsWithDatastore(hosts []types.ManagedObjectReference, path string) []types.ManagedObjectReference { attached := hosts[:0] var p object.DatastorePath p.FromString(path) for _, host := range hosts { h := Map.Get(host).(*HostSystem) if Map.FindByName(p.Datastore, h.Datastore) != nil { attached = append...
[ "func", "hostsWithDatastore", "(", "hosts", "[", "]", "types", ".", "ManagedObjectReference", ",", "path", "string", ")", "[", "]", "types", ".", "ManagedObjectReference", "{", "attached", ":=", "hosts", "[", ":", "0", "]", "\n", "var", "p", "object", ".",...
// hostsWithDatastore returns hosts that have access to the given datastore path
[ "hostsWithDatastore", "returns", "hosts", "that", "have", "access", "to", "the", "given", "datastore", "path" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/folder.go#L260-L273
21,520
vmware/govmomi
ovf/env.go
Marshal
func (e Env) Marshal() (string, error) { x, err := xml.Marshal(e) if err != nil { return "", err } return fmt.Sprintf("%s%s", xml.Header, x), nil }
go
func (e Env) Marshal() (string, error) { x, err := xml.Marshal(e) if err != nil { return "", err } return fmt.Sprintf("%s%s", xml.Header, x), nil }
[ "func", "(", "e", "Env", ")", "Marshal", "(", ")", "(", "string", ",", "error", ")", "{", "x", ",", "err", ":=", "xml", ".", "Marshal", "(", "e", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", ...
// Marshal marshals Env to xml by using xml.Marshal.
[ "Marshal", "marshals", "Env", "to", "xml", "by", "using", "xml", ".", "Marshal", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/ovf/env.go#L72-L79
21,521
vmware/govmomi
ovf/env.go
MarshalManual
func (e Env) MarshalManual() string { var buffer bytes.Buffer buffer.WriteString(xml.Header) buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) buffer.WriteString(fmt.Sprint(ovfEn...
go
func (e Env) MarshalManual() string { var buffer bytes.Buffer buffer.WriteString(xml.Header) buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) buffer.WriteString(fmt.Sprint(ovfEn...
[ "func", "(", "e", "Env", ")", "MarshalManual", "(", ")", "string", "{", "var", "buffer", "bytes", ".", "Buffer", "\n\n", "buffer", ".", "WriteString", "(", "xml", ".", "Header", ")", "\n", "buffer", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", ...
// MarshalManual manually marshals Env to xml suitable for a vApp guest. // It exists to overcome the lack of expressiveness in Go's XML namespaces.
[ "MarshalManual", "manually", "marshals", "Env", "to", "xml", "suitable", "for", "a", "vApp", "guest", ".", "It", "exists", "to", "overcome", "the", "lack", "of", "expressiveness", "in", "Go", "s", "XML", "namespaces", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/ovf/env.go#L83-L99
21,522
vmware/govmomi
vim25/xml/read.go
DecodeElement
func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { val := reflect.ValueOf(v) if val.Kind() != reflect.Ptr { return errors.New("non-pointer passed to Unmarshal") } return d.unmarshal(val.Elem(), start) }
go
func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { val := reflect.ValueOf(v) if val.Kind() != reflect.Ptr { return errors.New("non-pointer passed to Unmarshal") } return d.unmarshal(val.Elem(), start) }
[ "func", "(", "d", "*", "Decoder", ")", "DecodeElement", "(", "v", "interface", "{", "}", ",", "start", "*", "StartElement", ")", "error", "{", "val", ":=", "reflect", ".", "ValueOf", "(", "v", ")", "\n", "if", "val", ".", "Kind", "(", ")", "!=", ...
// DecodeElement works like xml.Unmarshal except that it takes // a pointer to the start XML element to decode into v. // It is useful when a client reads some raw XML tokens itself // but also wants to defer to Unmarshal for some elements.
[ "DecodeElement", "works", "like", "xml", ".", "Unmarshal", "except", "that", "it", "takes", "a", "pointer", "to", "the", "start", "XML", "element", "to", "decode", "into", "v", ".", "It", "is", "useful", "when", "a", "client", "reads", "some", "raw", "XM...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/read.go#L128-L134
21,523
vmware/govmomi
vim25/xml/read.go
receiverType
func receiverType(val interface{}) string { t := reflect.TypeOf(val) if t.Name() != "" { return t.String() } return "(" + t.String() + ")" }
go
func receiverType(val interface{}) string { t := reflect.TypeOf(val) if t.Name() != "" { return t.String() } return "(" + t.String() + ")" }
[ "func", "receiverType", "(", "val", "interface", "{", "}", ")", "string", "{", "t", ":=", "reflect", ".", "TypeOf", "(", "val", ")", "\n", "if", "t", ".", "Name", "(", ")", "!=", "\"", "\"", "{", "return", "t", ".", "String", "(", ")", "\n", "}...
// receiverType returns the receiver type to use in an expression like "%s.MethodName".
[ "receiverType", "returns", "the", "receiver", "type", "to", "use", "in", "an", "expression", "like", "%s", ".", "MethodName", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/read.go#L173-L179
21,524
vmware/govmomi
vim25/xml/read.go
typeForElement
func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type { t := "" for i, a := range start.Attr { if a.Name == xmlSchemaInstance || a.Name == xsiType { t = a.Value // HACK: ensure xsi:type is last in the list to avoid using that value for // a "type" attribute, such as ManagedO...
go
func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type { t := "" for i, a := range start.Attr { if a.Name == xmlSchemaInstance || a.Name == xsiType { t = a.Value // HACK: ensure xsi:type is last in the list to avoid using that value for // a "type" attribute, such as ManagedO...
[ "func", "(", "p", "*", "Decoder", ")", "typeForElement", "(", "val", "reflect", ".", "Value", ",", "start", "*", "StartElement", ")", "reflect", ".", "Type", "{", "t", ":=", "\"", "\"", "\n", "for", "i", ",", "a", ":=", "range", "start", ".", "Attr...
// Find reflect.Type for an element's type attribute.
[ "Find", "reflect", ".", "Type", "for", "an", "element", "s", "type", "attribute", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/read.go#L272-L312
21,525
vmware/govmomi
vim25/xml/read.go
unmarshalPath
func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { recurse := false Loop: for i := range tinfo.fields { finfo := &tinfo.fields[i] if finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != "" && finfo.xmln...
go
func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { recurse := false Loop: for i := range tinfo.fields { finfo := &tinfo.fields[i] if finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != "" && finfo.xmln...
[ "func", "(", "p", "*", "Decoder", ")", "unmarshalPath", "(", "tinfo", "*", "typeInfo", ",", "sv", "reflect", ".", "Value", ",", "parents", "[", "]", "string", ",", "start", "*", "StartElement", ")", "(", "consumed", "bool", ",", "err", "error", ")", ...
// unmarshalPath walks down an XML structure looking for wanted // paths, and calls unmarshal on them. // The consumed result tells whether XML elements have been consumed // from the Decoder until start's matching end element, or if it's // still untouched because start is uninteresting for sv's fields.
[ "unmarshalPath", "walks", "down", "an", "XML", "structure", "looking", "for", "wanted", "paths", "and", "calls", "unmarshal", "on", "them", ".", "The", "consumed", "result", "tells", "whether", "XML", "elements", "have", "been", "consumed", "from", "the", "Dec...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/read.go#L701-L758
21,526
vmware/govmomi
vim25/xml/read.go
Skip
func (d *Decoder) Skip() error { for { tok, err := d.Token() if err != nil { return err } switch tok.(type) { case StartElement: if err := d.Skip(); err != nil { return err } case EndElement: return nil } } }
go
func (d *Decoder) Skip() error { for { tok, err := d.Token() if err != nil { return err } switch tok.(type) { case StartElement: if err := d.Skip(); err != nil { return err } case EndElement: return nil } } }
[ "func", "(", "d", "*", "Decoder", ")", "Skip", "(", ")", "error", "{", "for", "{", "tok", ",", "err", ":=", "d", ".", "Token", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "switch", "tok", ".", "(", "type",...
// Skip reads tokens until it has consumed the end element // matching the most recent start element already consumed. // It recurs if it encounters a start element, so it can be used to // skip nested structures. // It returns nil if it finds an end element matching the start // element; otherwise it returns an error ...
[ "Skip", "reads", "tokens", "until", "it", "has", "consumed", "the", "end", "element", "matching", "the", "most", "recent", "start", "element", "already", "consumed", ".", "It", "recurs", "if", "it", "encounters", "a", "start", "element", "so", "it", "can", ...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/read.go#L766-L781
21,527
vmware/govmomi
vapi/library/library_item_updatesession_file.go
AddLibraryItemFile
func (c *Manager) AddLibraryItemFile(ctx context.Context, sessionID string, updateFile UpdateFile) (*UpdateFileInfo, error) { url := internal.URL(c, internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("add") spec := struct { FileSpec UpdateFile `json:"file_spec"` }{updateFile} var res UpdateFileIn...
go
func (c *Manager) AddLibraryItemFile(ctx context.Context, sessionID string, updateFile UpdateFile) (*UpdateFileInfo, error) { url := internal.URL(c, internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("add") spec := struct { FileSpec UpdateFile `json:"file_spec"` }{updateFile} var res UpdateFileIn...
[ "func", "(", "c", "*", "Manager", ")", "AddLibraryItemFile", "(", "ctx", "context", ".", "Context", ",", "sessionID", "string", ",", "updateFile", "UpdateFile", ")", "(", "*", "UpdateFileInfo", ",", "error", ")", "{", "url", ":=", "internal", ".", "URL", ...
// AddLibraryItemFile adds a file
[ "AddLibraryItemFile", "adds", "a", "file" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/library/library_item_updatesession_file.go#L59-L66
21,528
vmware/govmomi
vapi/library/library_item_updatesession_file.go
AddLibraryItemFileFromURI
func (c *Manager) AddLibraryItemFileFromURI( ctx context.Context, sessionID, fileName, uri string) (*UpdateFileInfo, error) { n, fingerprint, err := GetContentLengthAndFingerprint(ctx, uri) if err != nil { return nil, err } info, err := c.AddLibraryItemFile(ctx, sessionID, UpdateFile{ Name: fileName, ...
go
func (c *Manager) AddLibraryItemFileFromURI( ctx context.Context, sessionID, fileName, uri string) (*UpdateFileInfo, error) { n, fingerprint, err := GetContentLengthAndFingerprint(ctx, uri) if err != nil { return nil, err } info, err := c.AddLibraryItemFile(ctx, sessionID, UpdateFile{ Name: fileName, ...
[ "func", "(", "c", "*", "Manager", ")", "AddLibraryItemFileFromURI", "(", "ctx", "context", ".", "Context", ",", "sessionID", ",", "fileName", ",", "uri", "string", ")", "(", "*", "UpdateFileInfo", ",", "error", ")", "{", "n", ",", "fingerprint", ",", "er...
// AddLibraryItemFileFromURI adds a file from a remote URI.
[ "AddLibraryItemFileFromURI", "adds", "a", "file", "from", "a", "remote", "URI", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/library/library_item_updatesession_file.go#L69-L92
21,529
vmware/govmomi
vapi/library/library_item_updatesession_file.go
GetLibraryItemUpdateSessionFile
func (c *Manager) GetLibraryItemUpdateSessionFile(ctx context.Context, sessionID string, fileName string) (*UpdateFileInfo, error) { url := internal.URL(c, internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("get") spec := struct { Name string `json:"file_name"` }{fileName} var res UpdateFileInfo ...
go
func (c *Manager) GetLibraryItemUpdateSessionFile(ctx context.Context, sessionID string, fileName string) (*UpdateFileInfo, error) { url := internal.URL(c, internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("get") spec := struct { Name string `json:"file_name"` }{fileName} var res UpdateFileInfo ...
[ "func", "(", "c", "*", "Manager", ")", "GetLibraryItemUpdateSessionFile", "(", "ctx", "context", ".", "Context", ",", "sessionID", "string", ",", "fileName", "string", ")", "(", "*", "UpdateFileInfo", ",", "error", ")", "{", "url", ":=", "internal", ".", "...
// GetLibraryItemUpdateSessionFile retrieves information about a specific file // that is a part of an update session.
[ "GetLibraryItemUpdateSessionFile", "retrieves", "information", "about", "a", "specific", "file", "that", "is", "a", "part", "of", "an", "update", "session", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/library/library_item_updatesession_file.go#L96-L103
21,530
vmware/govmomi
vapi/library/library_item_updatesession_file.go
GetContentLengthAndFingerprint
func GetContentLengthAndFingerprint( ctx context.Context, uri string) (int64, string, error) { resp, err := http.Head(uri) if err != nil { return 0, "", err } if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 { return resp.ContentLength, "", nil } fingerprint := &bytes.Buffer{} sum := sha1.Sum(resp....
go
func GetContentLengthAndFingerprint( ctx context.Context, uri string) (int64, string, error) { resp, err := http.Head(uri) if err != nil { return 0, "", err } if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 { return resp.ContentLength, "", nil } fingerprint := &bytes.Buffer{} sum := sha1.Sum(resp....
[ "func", "GetContentLengthAndFingerprint", "(", "ctx", "context", ".", "Context", ",", "uri", "string", ")", "(", "int64", ",", "string", ",", "error", ")", "{", "resp", ",", "err", ":=", "http", ".", "Head", "(", "uri", ")", "\n", "if", "err", "!=", ...
// GetContentLengthAndFingerprint gets the number of bytes returned // by the URI as well as the SHA1 fingerprint of the peer certificate // if the URI's scheme is https.
[ "GetContentLengthAndFingerprint", "gets", "the", "number", "of", "bytes", "returned", "by", "the", "URI", "as", "well", "as", "the", "SHA1", "fingerprint", "of", "the", "peer", "certificate", "if", "the", "URI", "s", "scheme", "is", "https", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/library/library_item_updatesession_file.go#L108-L126
21,531
vmware/govmomi
simulator/event_manager.go
formatMessage
func (m *EventManager) formatMessage(event types.BaseEvent) { id := reflect.ValueOf(event).Elem().Type().Name() e := event.GetEvent() t, ok := m.templates[id] if !ok { for _, info := range m.Description.EventInfo { if info.Key == id { t = template.Must(template.New(id).Parse(info.FullFormat)) m.templa...
go
func (m *EventManager) formatMessage(event types.BaseEvent) { id := reflect.ValueOf(event).Elem().Type().Name() e := event.GetEvent() t, ok := m.templates[id] if !ok { for _, info := range m.Description.EventInfo { if info.Key == id { t = template.Must(template.New(id).Parse(info.FullFormat)) m.templa...
[ "func", "(", "m", "*", "EventManager", ")", "formatMessage", "(", "event", "types", ".", "BaseEvent", ")", "{", "id", ":=", "reflect", ".", "ValueOf", "(", "event", ")", ".", "Elem", "(", ")", ".", "Type", "(", ")", ".", "Name", "(", ")", "\n", "...
// formatMessage applies the EventDescriptionEventDetail.FullFormat template to the given event's FullFormattedMessage field.
[ "formatMessage", "applies", "the", "EventDescriptionEventDetail", ".", "FullFormat", "template", "to", "the", "given", "event", "s", "FullFormattedMessage", "field", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L126-L152
21,532
vmware/govmomi
simulator/event_manager.go
doEntityEventArgument
func doEntityEventArgument(event types.BaseEvent, f func(types.ManagedObjectReference, *types.EntityEventArgument) bool) bool { e := event.GetEvent() if arg := e.Vm; arg != nil { if f(arg.Vm, &arg.EntityEventArgument) { return true } } if arg := e.Host; arg != nil { if f(arg.Host, &arg.EntityEventArgumen...
go
func doEntityEventArgument(event types.BaseEvent, f func(types.ManagedObjectReference, *types.EntityEventArgument) bool) bool { e := event.GetEvent() if arg := e.Vm; arg != nil { if f(arg.Vm, &arg.EntityEventArgument) { return true } } if arg := e.Host; arg != nil { if f(arg.Host, &arg.EntityEventArgumen...
[ "func", "doEntityEventArgument", "(", "event", "types", ".", "BaseEvent", ",", "f", "func", "(", "types", ".", "ManagedObjectReference", ",", "*", "types", ".", "EntityEventArgument", ")", "bool", ")", "bool", "{", "e", ":=", "event", ".", "GetEvent", "(", ...
// doEntityEventArgument calls f for each entity argument in the event. // If f returns true, the iteration stops.
[ "doEntityEventArgument", "calls", "f", "for", "each", "entity", "argument", "in", "the", "event", ".", "If", "f", "returns", "true", "the", "iteration", "stops", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L191-L237
21,533
vmware/govmomi
simulator/event_manager.go
eventFilterSelf
func eventFilterSelf(event types.BaseEvent, self types.ManagedObjectReference) bool { return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { return self == ref }) }
go
func eventFilterSelf(event types.BaseEvent, self types.ManagedObjectReference) bool { return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { return self == ref }) }
[ "func", "eventFilterSelf", "(", "event", "types", ".", "BaseEvent", ",", "self", "types", ".", "ManagedObjectReference", ")", "bool", "{", "return", "doEntityEventArgument", "(", "event", ",", "func", "(", "ref", "types", ".", "ManagedObjectReference", ",", "_",...
// eventFilterSelf returns true if self is one of the entity arguments in the event.
[ "eventFilterSelf", "returns", "true", "if", "self", "is", "one", "of", "the", "entity", "arguments", "in", "the", "event", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L240-L244
21,534
vmware/govmomi
simulator/event_manager.go
eventFilterChildren
func eventFilterChildren(event types.BaseEvent, self types.ManagedObjectReference) bool { return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { seen := false var match func(types.ManagedObjectReference) match = func(child types.ManagedObjectReference) {...
go
func eventFilterChildren(event types.BaseEvent, self types.ManagedObjectReference) bool { return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool { seen := false var match func(types.ManagedObjectReference) match = func(child types.ManagedObjectReference) {...
[ "func", "eventFilterChildren", "(", "event", "types", ".", "BaseEvent", ",", "self", "types", ".", "ManagedObjectReference", ")", "bool", "{", "return", "doEntityEventArgument", "(", "event", ",", "func", "(", "ref", "types", ".", "ManagedObjectReference", ",", ...
// eventFilterChildren returns true if a child of self is one of the entity arguments in the event.
[ "eventFilterChildren", "returns", "true", "if", "a", "child", "of", "self", "is", "one", "of", "the", "entity", "arguments", "in", "the", "event", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L247-L266
21,535
vmware/govmomi
simulator/event_manager.go
entityMatches
func (c *EventHistoryCollector) entityMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { e := spec.Entity if e == nil { return true } isRootFolder := c.m.root == e.Entity switch e.Recursion { case types.EventFilterSpecRecursionOptionSelf: return isRootFolder || eventFilterSelf(event, e.Entit...
go
func (c *EventHistoryCollector) entityMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { e := spec.Entity if e == nil { return true } isRootFolder := c.m.root == e.Entity switch e.Recursion { case types.EventFilterSpecRecursionOptionSelf: return isRootFolder || eventFilterSelf(event, e.Entit...
[ "func", "(", "c", "*", "EventHistoryCollector", ")", "entityMatches", "(", "event", "types", ".", "BaseEvent", ",", "spec", "*", "types", ".", "EventFilterSpec", ")", "bool", "{", "e", ":=", "spec", ".", "Entity", "\n", "if", "e", "==", "nil", "{", "re...
// entityMatches returns true if the spec Entity filter matches the event.
[ "entityMatches", "returns", "true", "if", "the", "spec", "Entity", "filter", "matches", "the", "event", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L269-L290
21,536
vmware/govmomi
simulator/event_manager.go
typeMatches
func (c *EventHistoryCollector) typeMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { if len(spec.EventTypeId) == 0 { return true } matches := func(name string) bool { for _, id := range spec.EventTypeId { if id == name { return true } } return false } kind := reflect.ValueOf(ev...
go
func (c *EventHistoryCollector) typeMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { if len(spec.EventTypeId) == 0 { return true } matches := func(name string) bool { for _, id := range spec.EventTypeId { if id == name { return true } } return false } kind := reflect.ValueOf(ev...
[ "func", "(", "c", "*", "EventHistoryCollector", ")", "typeMatches", "(", "event", "types", ".", "BaseEvent", ",", "spec", "*", "types", ".", "EventFilterSpec", ")", "bool", "{", "if", "len", "(", "spec", ".", "EventTypeId", ")", "==", "0", "{", "return",...
// typeMatches returns true if one of the spec EventTypeId types matches the event.
[ "typeMatches", "returns", "true", "if", "one", "of", "the", "spec", "EventTypeId", "types", "matches", "the", "event", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L293-L317
21,537
vmware/govmomi
simulator/event_manager.go
eventMatches
func (c *EventHistoryCollector) eventMatches(event types.BaseEvent) bool { spec := c.Filter.(types.EventFilterSpec) if !c.typeMatches(event, &spec) { return false } // TODO: spec.Time, spec.UserName, etc return c.entityMatches(event, &spec) }
go
func (c *EventHistoryCollector) eventMatches(event types.BaseEvent) bool { spec := c.Filter.(types.EventFilterSpec) if !c.typeMatches(event, &spec) { return false } // TODO: spec.Time, spec.UserName, etc return c.entityMatches(event, &spec) }
[ "func", "(", "c", "*", "EventHistoryCollector", ")", "eventMatches", "(", "event", "types", ".", "BaseEvent", ")", "bool", "{", "spec", ":=", "c", ".", "Filter", ".", "(", "types", ".", "EventFilterSpec", ")", "\n\n", "if", "!", "c", ".", "typeMatches", ...
// eventMatches returns true one of the filters matches the event.
[ "eventMatches", "returns", "true", "one", "of", "the", "filters", "matches", "the", "event", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L320-L330
21,538
vmware/govmomi
simulator/event_manager.go
fillPage
func (c *EventHistoryCollector) fillPage(size int) { c.pos = 0 l := c.page.Len() delta := size - l if delta < 0 { // Shrink ring size c.page = c.page.Unlink(-delta) return } matches := 0 mpage := c.m.page page := c.page if delta != 0 { // Grow ring size c.page = c.page.Link(ring.New(delta)) } f...
go
func (c *EventHistoryCollector) fillPage(size int) { c.pos = 0 l := c.page.Len() delta := size - l if delta < 0 { // Shrink ring size c.page = c.page.Unlink(-delta) return } matches := 0 mpage := c.m.page page := c.page if delta != 0 { // Grow ring size c.page = c.page.Link(ring.New(delta)) } f...
[ "func", "(", "c", "*", "EventHistoryCollector", ")", "fillPage", "(", "size", "int", ")", "{", "c", ".", "pos", "=", "0", "\n", "l", ":=", "c", ".", "page", ".", "Len", "(", ")", "\n", "delta", ":=", "size", "-", "l", "\n\n", "if", "delta", "<"...
// filePage copies the manager's latest events into the collector's page with Filter applied.
[ "filePage", "copies", "the", "manager", "s", "latest", "events", "into", "the", "collector", "s", "page", "with", "Filter", "applied", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/simulator/event_manager.go#L333-L369
21,539
vmware/govmomi
object/virtual_disk_manager.go
CopyVirtualDisk
func (m VirtualDiskManager) CopyVirtualDisk( ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destName string, destDatacenter *Datacenter, destSpec *types.VirtualDiskSpec, force bool) (*Task, error) { req := types.CopyVirtualDisk_Task{ This: m.Reference(), SourceName: sourceName, ...
go
func (m VirtualDiskManager) CopyVirtualDisk( ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destName string, destDatacenter *Datacenter, destSpec *types.VirtualDiskSpec, force bool) (*Task, error) { req := types.CopyVirtualDisk_Task{ This: m.Reference(), SourceName: sourceName, ...
[ "func", "(", "m", "VirtualDiskManager", ")", "CopyVirtualDisk", "(", "ctx", "context", ".", "Context", ",", "sourceName", "string", ",", "sourceDatacenter", "*", "Datacenter", ",", "destName", "string", ",", "destDatacenter", "*", "Datacenter", ",", "destSpec", ...
// CopyVirtualDisk copies a virtual disk, performing conversions as specified in the spec.
[ "CopyVirtualDisk", "copies", "a", "virtual", "disk", "performing", "conversions", "as", "specified", "in", "the", "spec", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/virtual_disk_manager.go#L40-L70
21,540
vmware/govmomi
object/virtual_disk_manager.go
CreateVirtualDisk
func (m VirtualDiskManager) CreateVirtualDisk( ctx context.Context, name string, datacenter *Datacenter, spec types.BaseVirtualDiskSpec) (*Task, error) { req := types.CreateVirtualDisk_Task{ This: m.Reference(), Name: name, Spec: spec, } if datacenter != nil { ref := datacenter.Reference() req.Datacen...
go
func (m VirtualDiskManager) CreateVirtualDisk( ctx context.Context, name string, datacenter *Datacenter, spec types.BaseVirtualDiskSpec) (*Task, error) { req := types.CreateVirtualDisk_Task{ This: m.Reference(), Name: name, Spec: spec, } if datacenter != nil { ref := datacenter.Reference() req.Datacen...
[ "func", "(", "m", "VirtualDiskManager", ")", "CreateVirtualDisk", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "datacenter", "*", "Datacenter", ",", "spec", "types", ".", "BaseVirtualDiskSpec", ")", "(", "*", "Task", ",", "error", ")", ...
// CreateVirtualDisk creates a new virtual disk.
[ "CreateVirtualDisk", "creates", "a", "new", "virtual", "disk", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/virtual_disk_manager.go#L73-L95
21,541
vmware/govmomi
object/virtual_disk_manager.go
ShrinkVirtualDisk
func (m VirtualDiskManager) ShrinkVirtualDisk(ctx context.Context, name string, dc *Datacenter, copy *bool) (*Task, error) { req := types.ShrinkVirtualDisk_Task{ This: m.Reference(), Name: name, Copy: copy, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } res, err := methods.ShrinkVirtual...
go
func (m VirtualDiskManager) ShrinkVirtualDisk(ctx context.Context, name string, dc *Datacenter, copy *bool) (*Task, error) { req := types.ShrinkVirtualDisk_Task{ This: m.Reference(), Name: name, Copy: copy, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } res, err := methods.ShrinkVirtual...
[ "func", "(", "m", "VirtualDiskManager", ")", "ShrinkVirtualDisk", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "dc", "*", "Datacenter", ",", "copy", "*", "bool", ")", "(", "*", "Task", ",", "error", ")", "{", "req", ":=", "types",...
// ShrinkVirtualDisk shrinks a virtual disk.
[ "ShrinkVirtualDisk", "shrinks", "a", "virtual", "disk", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/virtual_disk_manager.go#L169-L187
21,542
vmware/govmomi
object/virtual_disk_manager.go
QueryVirtualDiskUuid
func (m VirtualDiskManager) QueryVirtualDiskUuid(ctx context.Context, name string, dc *Datacenter) (string, error) { req := types.QueryVirtualDiskUuid{ This: m.Reference(), Name: name, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } res, err := methods.QueryVirtualDiskUuid(ctx, m.c, &req) ...
go
func (m VirtualDiskManager) QueryVirtualDiskUuid(ctx context.Context, name string, dc *Datacenter) (string, error) { req := types.QueryVirtualDiskUuid{ This: m.Reference(), Name: name, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } res, err := methods.QueryVirtualDiskUuid(ctx, m.c, &req) ...
[ "func", "(", "m", "VirtualDiskManager", ")", "QueryVirtualDiskUuid", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "dc", "*", "Datacenter", ")", "(", "string", ",", "error", ")", "{", "req", ":=", "types", ".", "QueryVirtualDiskUuid", ...
// Queries virtual disk uuid
[ "Queries", "virtual", "disk", "uuid" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/virtual_disk_manager.go#L190-L211
21,543
vmware/govmomi
toolbox/service.go
NewService
func NewService(rpcIn Channel, rpcOut Channel) *Service { s := &Service{ name: "toolbox", // Same name used by vmtoolsd in: NewTraceChannel(rpcIn), out: &ChannelOut{NewTraceChannel(rpcOut)}, handlers: make(map[string]Handler), wg: new(sync.WaitGroup), stop: make(chan struct{}), ...
go
func NewService(rpcIn Channel, rpcOut Channel) *Service { s := &Service{ name: "toolbox", // Same name used by vmtoolsd in: NewTraceChannel(rpcIn), out: &ChannelOut{NewTraceChannel(rpcOut)}, handlers: make(map[string]Handler), wg: new(sync.WaitGroup), stop: make(chan struct{}), ...
[ "func", "NewService", "(", "rpcIn", "Channel", ",", "rpcOut", "Channel", ")", "*", "Service", "{", "s", ":=", "&", "Service", "{", "name", ":", "\"", "\"", ",", "// Same name used by vmtoolsd", "in", ":", "NewTraceChannel", "(", "rpcIn", ")", ",", "out", ...
// NewService initializes a Service instance
[ "NewService", "initializes", "a", "Service", "instance" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L75-L100
21,544
vmware/govmomi
toolbox/service.go
backoff
func (s *Service) backoff() { if s.delay < maxDelay { if s.delay > 0 { d := s.delay * 2 if d > s.delay && d < maxDelay { s.delay = d } else { s.delay = maxDelay } } else { s.delay = 1 } } }
go
func (s *Service) backoff() { if s.delay < maxDelay { if s.delay > 0 { d := s.delay * 2 if d > s.delay && d < maxDelay { s.delay = d } else { s.delay = maxDelay } } else { s.delay = 1 } } }
[ "func", "(", "s", "*", "Service", ")", "backoff", "(", ")", "{", "if", "s", ".", "delay", "<", "maxDelay", "{", "if", "s", ".", "delay", ">", "0", "{", "d", ":=", "s", ".", "delay", "*", "2", "\n", "if", "d", ">", "s", ".", "delay", "&&", ...
// backoff exponentially increases the RPC poll delay up to maxDelay
[ "backoff", "exponentially", "increases", "the", "RPC", "poll", "delay", "up", "to", "maxDelay" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L103-L116
21,545
vmware/govmomi
toolbox/service.go
Start
func (s *Service) Start() error { err := s.startChannel() if err != nil { return err } s.wg.Add(1) go func() { defer s.wg.Done() // Same polling interval and backoff logic as vmtoolsd. // Required in our case at startup at least, otherwise it is possible // we miss the 1 Capabilities_Register call for ...
go
func (s *Service) Start() error { err := s.startChannel() if err != nil { return err } s.wg.Add(1) go func() { defer s.wg.Done() // Same polling interval and backoff logic as vmtoolsd. // Required in our case at startup at least, otherwise it is possible // we miss the 1 Capabilities_Register call for ...
[ "func", "(", "s", "*", "Service", ")", "Start", "(", ")", "error", "{", "err", ":=", "s", ".", "startChannel", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "s", ".", "wg", ".", "Add", "(", "1", ")", "\n",...
// Start initializes the RPC channels and starts a goroutine to listen for incoming RPC requests
[ "Start", "initializes", "the", "RPC", "channels", "and", "starts", "a", "goroutine", "to", "listen", "for", "incoming", "RPC", "requests" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L147-L196
21,546
vmware/govmomi
toolbox/service.go
RegisterHandler
func (s *Service) RegisterHandler(name string, handler Handler) { s.handlers[name] = handler }
go
func (s *Service) RegisterHandler(name string, handler Handler) { s.handlers[name] = handler }
[ "func", "(", "s", "*", "Service", ")", "RegisterHandler", "(", "name", "string", ",", "handler", "Handler", ")", "{", "s", ".", "handlers", "[", "name", "]", "=", "handler", "\n", "}" ]
// RegisterHandler for the given RPC name
[ "RegisterHandler", "for", "the", "given", "RPC", "name" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L212-L214
21,547
vmware/govmomi
toolbox/service.go
Dispatch
func (s *Service) Dispatch(request []byte) []byte { msg := bytes.SplitN(request, []byte{' '}, 2) name := msg[0] // Trim NULL byte terminator name = bytes.TrimRight(name, "\x00") handler, ok := s.handlers[string(name)] if !ok { log.Printf("unknown command: %q\n", name) return []byte("Unknown Command") } ...
go
func (s *Service) Dispatch(request []byte) []byte { msg := bytes.SplitN(request, []byte{' '}, 2) name := msg[0] // Trim NULL byte terminator name = bytes.TrimRight(name, "\x00") handler, ok := s.handlers[string(name)] if !ok { log.Printf("unknown command: %q\n", name) return []byte("Unknown Command") } ...
[ "func", "(", "s", "*", "Service", ")", "Dispatch", "(", "request", "[", "]", "byte", ")", "[", "]", "byte", "{", "msg", ":=", "bytes", ".", "SplitN", "(", "request", ",", "[", "]", "byte", "{", "' '", "}", ",", "2", ")", "\n", "name", ":=", "...
// Dispatch an incoming RPC request to a Handler
[ "Dispatch", "an", "incoming", "RPC", "request", "to", "a", "Handler" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L217-L245
21,548
vmware/govmomi
toolbox/service.go
Reset
func (s *Service) Reset([]byte) ([]byte, error) { s.SendGuestInfo() // Send the IP info ASAP return []byte("ATR " + s.name), nil }
go
func (s *Service) Reset([]byte) ([]byte, error) { s.SendGuestInfo() // Send the IP info ASAP return []byte("ATR " + s.name), nil }
[ "func", "(", "s", "*", "Service", ")", "Reset", "(", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "s", ".", "SendGuestInfo", "(", ")", "// Send the IP info ASAP", "\n\n", "return", "[", "]", "byte", "(", "\"", "\"", "+", ...
// Reset is the default Handler for reset requests
[ "Reset", "is", "the", "default", "Handler", "for", "reset", "requests" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L248-L252
21,549
vmware/govmomi
toolbox/service.go
SetOption
func (s *Service) SetOption(args []byte) ([]byte, error) { opts := bytes.SplitN(args, []byte{' '}, 2) key := string(opts[0]) val := string(opts[1]) if Trace { fmt.Fprintf(os.Stderr, "set option %q=%q\n", key, val) } switch key { case "broadcastIP": // TODO: const-ify if val == "1" { ip := s.PrimaryIP() ...
go
func (s *Service) SetOption(args []byte) ([]byte, error) { opts := bytes.SplitN(args, []byte{' '}, 2) key := string(opts[0]) val := string(opts[1]) if Trace { fmt.Fprintf(os.Stderr, "set option %q=%q\n", key, val) } switch key { case "broadcastIP": // TODO: const-ify if val == "1" { ip := s.PrimaryIP() ...
[ "func", "(", "s", "*", "Service", ")", "SetOption", "(", "args", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "opts", ":=", "bytes", ".", "SplitN", "(", "args", ",", "[", "]", "byte", "{", "' '", "}", ",", "2", ")", ...
// SetOption is the default Handler for Set_Option requests
[ "SetOption", "is", "the", "default", "Handler", "for", "Set_Option", "requests" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L260-L290
21,550
vmware/govmomi
toolbox/service.go
DefaultIP
func DefaultIP() string { addrs, err := netInterfaceAddrs() if err == nil { for _, addr := range addrs { if ip, ok := addr.(*net.IPNet); ok && !ip.IP.IsLoopback() { if ip.IP.To4() != nil { return ip.IP.String() } } } } return "" }
go
func DefaultIP() string { addrs, err := netInterfaceAddrs() if err == nil { for _, addr := range addrs { if ip, ok := addr.(*net.IPNet); ok && !ip.IP.IsLoopback() { if ip.IP.To4() != nil { return ip.IP.String() } } } } return "" }
[ "func", "DefaultIP", "(", ")", "string", "{", "addrs", ",", "err", ":=", "netInterfaceAddrs", "(", ")", "\n", "if", "err", "==", "nil", "{", "for", "_", ",", "addr", ":=", "range", "addrs", "{", "if", "ip", ",", "ok", ":=", "addr", ".", "(", "*",...
// DefaultIP is used by default when responding to a Set_Option broadcastIP request // It can be overridden with the Service.PrimaryIP field
[ "DefaultIP", "is", "used", "by", "default", "when", "responding", "to", "a", "Set_Option", "broadcastIP", "request", "It", "can", "be", "overridden", "with", "the", "Service", ".", "PrimaryIP", "field" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/toolbox/service.go#L294-L307
21,551
vmware/govmomi
object/namespace_manager.go
CreateDirectory
func (nm DatastoreNamespaceManager) CreateDirectory(ctx context.Context, ds *Datastore, displayName string, policy string) (string, error) { req := &types.CreateDirectory{ This: nm.Reference(), Datastore: ds.Reference(), DisplayName: displayName, Policy: policy, } resp, err := methods.CreateD...
go
func (nm DatastoreNamespaceManager) CreateDirectory(ctx context.Context, ds *Datastore, displayName string, policy string) (string, error) { req := &types.CreateDirectory{ This: nm.Reference(), Datastore: ds.Reference(), DisplayName: displayName, Policy: policy, } resp, err := methods.CreateD...
[ "func", "(", "nm", "DatastoreNamespaceManager", ")", "CreateDirectory", "(", "ctx", "context", ".", "Context", ",", "ds", "*", "Datastore", ",", "displayName", "string", ",", "policy", "string", ")", "(", "string", ",", "error", ")", "{", "req", ":=", "&",...
// CreateDirectory creates a top-level directory on the given vsan datastore, using // the given user display name hint and opaque storage policy.
[ "CreateDirectory", "creates", "a", "top", "-", "level", "directory", "on", "the", "given", "vsan", "datastore", "using", "the", "given", "user", "display", "name", "hint", "and", "opaque", "storage", "policy", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/namespace_manager.go#L41-L56
21,552
vmware/govmomi
object/namespace_manager.go
DeleteDirectory
func (nm DatastoreNamespaceManager) DeleteDirectory(ctx context.Context, dc *Datacenter, datastorePath string) error { req := &types.DeleteDirectory{ This: nm.Reference(), DatastorePath: datastorePath, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } if _, err := methods.DeleteDir...
go
func (nm DatastoreNamespaceManager) DeleteDirectory(ctx context.Context, dc *Datacenter, datastorePath string) error { req := &types.DeleteDirectory{ This: nm.Reference(), DatastorePath: datastorePath, } if dc != nil { ref := dc.Reference() req.Datacenter = &ref } if _, err := methods.DeleteDir...
[ "func", "(", "nm", "DatastoreNamespaceManager", ")", "DeleteDirectory", "(", "ctx", "context", ".", "Context", ",", "dc", "*", "Datacenter", ",", "datastorePath", "string", ")", "error", "{", "req", ":=", "&", "types", ".", "DeleteDirectory", "{", "This", ":...
// DeleteDirectory deletes the given top-level directory from a vsan datastore.
[ "DeleteDirectory", "deletes", "the", "given", "top", "-", "level", "directory", "from", "a", "vsan", "datastore", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/namespace_manager.go#L59-L76
21,553
vmware/govmomi
performance/manager.go
NewManager
func NewManager(client *vim25.Client) *Manager { m := Manager{ Common: object.NewCommon(client, *client.ServiceContent.PerfManager), } m.pm.PerformanceManager = new(mo.PerformanceManager) return &m }
go
func NewManager(client *vim25.Client) *Manager { m := Manager{ Common: object.NewCommon(client, *client.ServiceContent.PerfManager), } m.pm.PerformanceManager = new(mo.PerformanceManager) return &m }
[ "func", "NewManager", "(", "client", "*", "vim25", ".", "Client", ")", "*", "Manager", "{", "m", ":=", "Manager", "{", "Common", ":", "object", ".", "NewCommon", "(", "client", ",", "*", "client", ".", "ServiceContent", ".", "PerfManager", ")", ",", "}...
// NewManager creates a new Manager instance.
[ "NewManager", "creates", "a", "new", "Manager", "instance", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L58-L66
21,554
vmware/govmomi
performance/manager.go
HistoricalInterval
func (m *Manager) HistoricalInterval(ctx context.Context) (IntervalList, error) { var pm mo.PerformanceManager err := m.Properties(ctx, m.Reference(), []string{"historicalInterval"}, &pm) if err != nil { return nil, err } return IntervalList(pm.HistoricalInterval), nil }
go
func (m *Manager) HistoricalInterval(ctx context.Context) (IntervalList, error) { var pm mo.PerformanceManager err := m.Properties(ctx, m.Reference(), []string{"historicalInterval"}, &pm) if err != nil { return nil, err } return IntervalList(pm.HistoricalInterval), nil }
[ "func", "(", "m", "*", "Manager", ")", "HistoricalInterval", "(", "ctx", "context", ".", "Context", ")", "(", "IntervalList", ",", "error", ")", "{", "var", "pm", "mo", ".", "PerformanceManager", "\n\n", "err", ":=", "m", ".", "Properties", "(", "ctx", ...
// HistoricalInterval gets the PerformanceManager.HistoricalInterval property and wraps as an IntervalList.
[ "HistoricalInterval", "gets", "the", "PerformanceManager", ".", "HistoricalInterval", "property", "and", "wraps", "as", "an", "IntervalList", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L91-L100
21,555
vmware/govmomi
performance/manager.go
CounterInfo
func (m *Manager) CounterInfo(ctx context.Context) ([]types.PerfCounterInfo, error) { m.pm.Lock() defer m.pm.Unlock() if len(m.pm.PerfCounter) == 0 { err := m.Properties(ctx, m.Reference(), []string{"perfCounter"}, m.pm.PerformanceManager) if err != nil { return nil, err } } return m.pm.PerfCounter, nil...
go
func (m *Manager) CounterInfo(ctx context.Context) ([]types.PerfCounterInfo, error) { m.pm.Lock() defer m.pm.Unlock() if len(m.pm.PerfCounter) == 0 { err := m.Properties(ctx, m.Reference(), []string{"perfCounter"}, m.pm.PerformanceManager) if err != nil { return nil, err } } return m.pm.PerfCounter, nil...
[ "func", "(", "m", "*", "Manager", ")", "CounterInfo", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "types", ".", "PerfCounterInfo", ",", "error", ")", "{", "m", ".", "pm", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "pm", ".", ...
// CounterInfo gets the PerformanceManager.PerfCounter property. // The property value is only collected once, subsequent calls return the cached value.
[ "CounterInfo", "gets", "the", "PerformanceManager", ".", "PerfCounter", "property", ".", "The", "property", "value", "is", "only", "collected", "once", "subsequent", "calls", "return", "the", "cached", "value", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L104-L116
21,556
vmware/govmomi
performance/manager.go
CounterInfoByKey
func (m *Manager) CounterInfoByKey(ctx context.Context) (map[int32]*types.PerfCounterInfo, error) { m.infoByKey.Lock() defer m.infoByKey.Unlock() if m.infoByKey.m != nil { return m.infoByKey.m, nil } info, err := m.CounterInfo(ctx) if err != nil { return nil, err } m.infoByKey.m = make(map[int32]*types.P...
go
func (m *Manager) CounterInfoByKey(ctx context.Context) (map[int32]*types.PerfCounterInfo, error) { m.infoByKey.Lock() defer m.infoByKey.Unlock() if m.infoByKey.m != nil { return m.infoByKey.m, nil } info, err := m.CounterInfo(ctx) if err != nil { return nil, err } m.infoByKey.m = make(map[int32]*types.P...
[ "func", "(", "m", "*", "Manager", ")", "CounterInfoByKey", "(", "ctx", "context", ".", "Context", ")", "(", "map", "[", "int32", "]", "*", "types", ".", "PerfCounterInfo", ",", "error", ")", "{", "m", ".", "infoByKey", ".", "Lock", "(", ")", "\n", ...
// CounterInfoByKey converts the PerformanceManager.PerfCounter property to a map, // where key is types.PerfCounterInfo.Key.
[ "CounterInfoByKey", "converts", "the", "PerformanceManager", ".", "PerfCounter", "property", "to", "a", "map", "where", "key", "is", "types", ".", "PerfCounterInfo", ".", "Key", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L146-L168
21,557
vmware/govmomi
performance/manager.go
ProviderSummary
func (m *Manager) ProviderSummary(ctx context.Context, entity types.ManagedObjectReference) (*types.PerfProviderSummary, error) { req := types.QueryPerfProviderSummary{ This: m.Reference(), Entity: entity, } res, err := methods.QueryPerfProviderSummary(ctx, m.Client(), &req) if err != nil { return nil, err...
go
func (m *Manager) ProviderSummary(ctx context.Context, entity types.ManagedObjectReference) (*types.PerfProviderSummary, error) { req := types.QueryPerfProviderSummary{ This: m.Reference(), Entity: entity, } res, err := methods.QueryPerfProviderSummary(ctx, m.Client(), &req) if err != nil { return nil, err...
[ "func", "(", "m", "*", "Manager", ")", "ProviderSummary", "(", "ctx", "context", ".", "Context", ",", "entity", "types", ".", "ManagedObjectReference", ")", "(", "*", "types", ".", "PerfProviderSummary", ",", "error", ")", "{", "req", ":=", "types", ".", ...
// ProviderSummary wraps the QueryPerfProviderSummary method, caching the value based on entity.Type.
[ "ProviderSummary", "wraps", "the", "QueryPerfProviderSummary", "method", "caching", "the", "value", "based", "on", "entity", ".", "Type", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L171-L183
21,558
vmware/govmomi
performance/manager.go
AvailableMetric
func (m *Manager) AvailableMetric(ctx context.Context, entity types.ManagedObjectReference, interval int32) (MetricList, error) { req := types.QueryAvailablePerfMetric{ This: m.Reference(), Entity: entity.Reference(), IntervalId: interval, } res, err := methods.QueryAvailablePerfMetric(ctx, m.Client...
go
func (m *Manager) AvailableMetric(ctx context.Context, entity types.ManagedObjectReference, interval int32) (MetricList, error) { req := types.QueryAvailablePerfMetric{ This: m.Reference(), Entity: entity.Reference(), IntervalId: interval, } res, err := methods.QueryAvailablePerfMetric(ctx, m.Client...
[ "func", "(", "m", "*", "Manager", ")", "AvailableMetric", "(", "ctx", "context", ".", "Context", ",", "entity", "types", ".", "ManagedObjectReference", ",", "interval", "int32", ")", "(", "MetricList", ",", "error", ")", "{", "req", ":=", "types", ".", "...
// AvailableMetric wraps the QueryAvailablePerfMetric method. // The MetricList is sorted by PerfCounterInfo.GroupInfo.Key if Manager.Sort == true.
[ "AvailableMetric", "wraps", "the", "QueryAvailablePerfMetric", "method", ".", "The", "MetricList", "is", "sorted", "by", "PerfCounterInfo", ".", "GroupInfo", ".", "Key", "if", "Manager", ".", "Sort", "==", "true", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L224-L246
21,559
vmware/govmomi
performance/manager.go
Query
func (m *Manager) Query(ctx context.Context, spec []types.PerfQuerySpec) ([]types.BasePerfEntityMetricBase, error) { req := types.QueryPerf{ This: m.Reference(), QuerySpec: spec, } res, err := methods.QueryPerf(ctx, m.Client(), &req) if err != nil { return nil, err } return res.Returnval, nil }
go
func (m *Manager) Query(ctx context.Context, spec []types.PerfQuerySpec) ([]types.BasePerfEntityMetricBase, error) { req := types.QueryPerf{ This: m.Reference(), QuerySpec: spec, } res, err := methods.QueryPerf(ctx, m.Client(), &req) if err != nil { return nil, err } return res.Returnval, nil }
[ "func", "(", "m", "*", "Manager", ")", "Query", "(", "ctx", "context", ".", "Context", ",", "spec", "[", "]", "types", ".", "PerfQuerySpec", ")", "(", "[", "]", "types", ".", "BasePerfEntityMetricBase", ",", "error", ")", "{", "req", ":=", "types", "...
// Query wraps the QueryPerf method.
[ "Query", "wraps", "the", "QueryPerf", "method", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L249-L261
21,560
vmware/govmomi
performance/manager.go
ValueCSV
func (s *MetricSeries) ValueCSV() string { vals := make([]string, len(s.Value)) for i := range s.Value { vals[i] = s.Format(s.Value[i]) } return strings.Join(vals, ",") }
go
func (s *MetricSeries) ValueCSV() string { vals := make([]string, len(s.Value)) for i := range s.Value { vals[i] = s.Format(s.Value[i]) } return strings.Join(vals, ",") }
[ "func", "(", "s", "*", "MetricSeries", ")", "ValueCSV", "(", ")", "string", "{", "vals", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "s", ".", "Value", ")", ")", "\n\n", "for", "i", ":=", "range", "s", ".", "Value", "{", "vals", "["...
// ValueCSV converts the Value field to a CSV string
[ "ValueCSV", "converts", "the", "Value", "field", "to", "a", "CSV", "string" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L341-L349
21,561
vmware/govmomi
performance/manager.go
SampleInfoCSV
func (m *EntityMetric) SampleInfoCSV() string { vals := make([]string, len(m.SampleInfo)*2) i := 0 for _, s := range m.SampleInfo { vals[i] = s.Timestamp.Format(time.RFC3339) i++ vals[i] = strconv.Itoa(int(s.Interval)) i++ } return strings.Join(vals, ",") }
go
func (m *EntityMetric) SampleInfoCSV() string { vals := make([]string, len(m.SampleInfo)*2) i := 0 for _, s := range m.SampleInfo { vals[i] = s.Timestamp.Format(time.RFC3339) i++ vals[i] = strconv.Itoa(int(s.Interval)) i++ } return strings.Join(vals, ",") }
[ "func", "(", "m", "*", "EntityMetric", ")", "SampleInfoCSV", "(", ")", "string", "{", "vals", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "m", ".", "SampleInfo", ")", "*", "2", ")", "\n\n", "i", ":=", "0", "\n\n", "for", "_", ",", "...
// SampleInfoCSV converts the SampleInfo field to a CSV string
[ "SampleInfoCSV", "converts", "the", "SampleInfo", "field", "to", "a", "CSV", "string" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/performance/manager.go#L360-L373
21,562
vmware/govmomi
govc/flags/host_connect.go
Spec
func (flag *HostConnectFlag) Spec(c *vim25.Client) types.HostConnectSpec { spec := flag.HostConnectSpec if spec.SslThumbprint == "" { spec.SslThumbprint = c.Thumbprint(spec.HostName) if spec.SslThumbprint == "" && flag.noverify { var info object.HostCertificateInfo t := c.Transport.(*http.Transport) _ ...
go
func (flag *HostConnectFlag) Spec(c *vim25.Client) types.HostConnectSpec { spec := flag.HostConnectSpec if spec.SslThumbprint == "" { spec.SslThumbprint = c.Thumbprint(spec.HostName) if spec.SslThumbprint == "" && flag.noverify { var info object.HostCertificateInfo t := c.Transport.(*http.Transport) _ ...
[ "func", "(", "flag", "*", "HostConnectFlag", ")", "Spec", "(", "c", "*", "vim25", ".", "Client", ")", "types", ".", "HostConnectSpec", "{", "spec", ":=", "flag", ".", "HostConnectSpec", "\n\n", "if", "spec", ".", "SslThumbprint", "==", "\"", "\"", "{", ...
// Spec attempts to fill in SslThumbprint if empty. // First checks GOVC_TLS_KNOWN_HOSTS, if not found and noverify=true then // use object.HostCertificateInfo to get the thumbprint.
[ "Spec", "attempts", "to", "fill", "in", "SslThumbprint", "if", "empty", ".", "First", "checks", "GOVC_TLS_KNOWN_HOSTS", "if", "not", "found", "and", "noverify", "=", "true", "then", "use", "object", ".", "HostCertificateInfo", "to", "get", "the", "thumbprint", ...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/flags/host_connect.go#L70-L85
21,563
vmware/govmomi
govc/flags/host_connect.go
Fault
func (flag *HostConnectFlag) Fault(err error) error { if err == nil { return nil } if f, ok := err.(types.HasFault); ok { switch fault := f.Fault().(type) { case *types.SSLVerifyFault: return fmt.Errorf("%s thumbprint=%s", err, fault.Thumbprint) } } return err }
go
func (flag *HostConnectFlag) Fault(err error) error { if err == nil { return nil } if f, ok := err.(types.HasFault); ok { switch fault := f.Fault().(type) { case *types.SSLVerifyFault: return fmt.Errorf("%s thumbprint=%s", err, fault.Thumbprint) } } return err }
[ "func", "(", "flag", "*", "HostConnectFlag", ")", "Fault", "(", "err", "error", ")", "error", "{", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "f", ",", "ok", ":=", "err", ".", "(", "types", ".", "HasFault", ")", ";",...
// Fault checks if error is SSLVerifyFault, including the thumbprint if so
[ "Fault", "checks", "if", "error", "is", "SSLVerifyFault", "including", "the", "thumbprint", "if", "so" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/govc/flags/host_connect.go#L88-L101
21,564
vmware/govmomi
guest/toolbox/client.go
Run
func (c *Client) Run(ctx context.Context, cmd *exec.Cmd) error { vc := c.ProcessManager.Client() spec := types.GuestProgramSpec{ ProgramPath: cmd.Path, Arguments: strings.Join(cmd.Args, " "), EnvVariables: cmd.Env, WorkingDirectory: cmd.Dir, } pid, serr := c.ProcessManager.StartProgram(ctx...
go
func (c *Client) Run(ctx context.Context, cmd *exec.Cmd) error { vc := c.ProcessManager.Client() spec := types.GuestProgramSpec{ ProgramPath: cmd.Path, Arguments: strings.Join(cmd.Args, " "), EnvVariables: cmd.Env, WorkingDirectory: cmd.Dir, } pid, serr := c.ProcessManager.StartProgram(ctx...
[ "func", "(", "c", "*", "Client", ")", "Run", "(", "ctx", "context", ".", "Context", ",", "cmd", "*", "exec", ".", "Cmd", ")", "error", "{", "vc", ":=", "c", ".", "ProcessManager", ".", "Client", "(", ")", "\n\n", "spec", ":=", "types", ".", "Gues...
// Run implements exec.Cmd.Run over vmx guest RPC.
[ "Run", "implements", "exec", ".", "Cmd", ".", "Run", "over", "vmx", "guest", "RPC", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/guest/toolbox/client.go#L141-L230
21,565
vmware/govmomi
guest/toolbox/client.go
Download
func (c *Client) Download(ctx context.Context, src string) (io.ReadCloser, int64, error) { vc := c.ProcessManager.Client() info, err := c.FileManager.InitiateFileTransferFromGuest(ctx, c.Authentication, src) if err != nil { return nil, 0, err } u, err := c.FileManager.TransferURL(ctx, info.Url) if err != nil ...
go
func (c *Client) Download(ctx context.Context, src string) (io.ReadCloser, int64, error) { vc := c.ProcessManager.Client() info, err := c.FileManager.InitiateFileTransferFromGuest(ctx, c.Authentication, src) if err != nil { return nil, 0, err } u, err := c.FileManager.TransferURL(ctx, info.Url) if err != nil ...
[ "func", "(", "c", "*", "Client", ")", "Download", "(", "ctx", "context", ".", "Context", ",", "src", "string", ")", "(", "io", ".", "ReadCloser", ",", "int64", ",", "error", ")", "{", "vc", ":=", "c", ".", "ProcessManager", ".", "Client", "(", ")",...
// Download initiates a file transfer from the guest
[ "Download", "initiates", "a", "file", "transfer", "from", "the", "guest" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/guest/toolbox/client.go#L272-L297
21,566
vmware/govmomi
guest/toolbox/client.go
Upload
func (c *Client) Upload(ctx context.Context, src io.Reader, dst string, p soap.Upload, attr types.BaseGuestFileAttributes, force bool) error { vc := c.ProcessManager.Client() var err error if p.ContentLength == 0 { // Content-Length is required switch r := src.(type) { case *bytes.Buffer: p.ContentLength = ...
go
func (c *Client) Upload(ctx context.Context, src io.Reader, dst string, p soap.Upload, attr types.BaseGuestFileAttributes, force bool) error { vc := c.ProcessManager.Client() var err error if p.ContentLength == 0 { // Content-Length is required switch r := src.(type) { case *bytes.Buffer: p.ContentLength = ...
[ "func", "(", "c", "*", "Client", ")", "Upload", "(", "ctx", "context", ".", "Context", ",", "src", "io", ".", "Reader", ",", "dst", "string", ",", "p", "soap", ".", "Upload", ",", "attr", "types", ".", "BaseGuestFileAttributes", ",", "force", "bool", ...
// Upload transfers a file to the guest
[ "Upload", "transfers", "a", "file", "to", "the", "guest" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/guest/toolbox/client.go#L300-L345
21,567
vmware/govmomi
object/host_firewall_system.go
ByRule
func (l HostFirewallRulesetList) ByRule(rule types.HostFirewallRule) HostFirewallRulesetList { var matches HostFirewallRulesetList for _, rs := range l { for _, r := range rs.Rule { if r.PortType != rule.PortType || r.Protocol != rule.Protocol || r.Direction != rule.Direction { continue } if ...
go
func (l HostFirewallRulesetList) ByRule(rule types.HostFirewallRule) HostFirewallRulesetList { var matches HostFirewallRulesetList for _, rs := range l { for _, r := range rs.Rule { if r.PortType != rule.PortType || r.Protocol != rule.Protocol || r.Direction != rule.Direction { continue } if ...
[ "func", "(", "l", "HostFirewallRulesetList", ")", "ByRule", "(", "rule", "types", ".", "HostFirewallRule", ")", "HostFirewallRulesetList", "{", "var", "matches", "HostFirewallRulesetList", "\n\n", "for", "_", ",", "rs", ":=", "range", "l", "{", "for", "_", ","...
// ByRule returns a HostFirewallRulesetList where Direction, PortType and Protocol are equal and Port is within range
[ "ByRule", "returns", "a", "HostFirewallRulesetList", "where", "Direction", "PortType", "and", "Protocol", "are", "equal", "and", "Port", "is", "within", "range" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_firewall_system.go#L85-L105
21,568
vmware/govmomi
object/host_firewall_system.go
Enabled
func (l HostFirewallRulesetList) Enabled() HostFirewallRulesetList { var matches HostFirewallRulesetList for _, rs := range l { if rs.Enabled { matches = append(matches, rs) } } return matches }
go
func (l HostFirewallRulesetList) Enabled() HostFirewallRulesetList { var matches HostFirewallRulesetList for _, rs := range l { if rs.Enabled { matches = append(matches, rs) } } return matches }
[ "func", "(", "l", "HostFirewallRulesetList", ")", "Enabled", "(", ")", "HostFirewallRulesetList", "{", "var", "matches", "HostFirewallRulesetList", "\n\n", "for", "_", ",", "rs", ":=", "range", "l", "{", "if", "rs", ".", "Enabled", "{", "matches", "=", "appe...
// Enabled returns a HostFirewallRulesetList with enabled rules
[ "Enabled", "returns", "a", "HostFirewallRulesetList", "with", "enabled", "rules" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_firewall_system.go#L147-L157
21,569
vmware/govmomi
object/host_firewall_system.go
Keys
func (l HostFirewallRulesetList) Keys() []string { var keys []string for _, rs := range l { keys = append(keys, rs.Key) } return keys }
go
func (l HostFirewallRulesetList) Keys() []string { var keys []string for _, rs := range l { keys = append(keys, rs.Key) } return keys }
[ "func", "(", "l", "HostFirewallRulesetList", ")", "Keys", "(", ")", "[", "]", "string", "{", "var", "keys", "[", "]", "string", "\n\n", "for", "_", ",", "rs", ":=", "range", "l", "{", "keys", "=", "append", "(", "keys", ",", "rs", ".", "Key", ")"...
// Keys returns the HostFirewallRuleset.Key for each ruleset in the list
[ "Keys", "returns", "the", "HostFirewallRuleset", ".", "Key", "for", "each", "ruleset", "in", "the", "list" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_firewall_system.go#L173-L181
21,570
vmware/govmomi
vim25/xml/xml.go
CopyToken
func CopyToken(t Token) Token { switch v := t.(type) { case CharData: return v.Copy() case Comment: return v.Copy() case Directive: return v.Copy() case ProcInst: return v.Copy() case StartElement: return v.Copy() } return t }
go
func CopyToken(t Token) Token { switch v := t.(type) { case CharData: return v.Copy() case Comment: return v.Copy() case Directive: return v.Copy() case ProcInst: return v.Copy() case StartElement: return v.Copy() } return t }
[ "func", "CopyToken", "(", "t", "Token", ")", "Token", "{", "switch", "v", ":=", "t", ".", "(", "type", ")", "{", "case", "CharData", ":", "return", "v", ".", "Copy", "(", ")", "\n", "case", "Comment", ":", "return", "v", ".", "Copy", "(", ")", ...
// CopyToken returns a copy of a Token.
[ "CopyToken", "returns", "a", "copy", "of", "a", "Token", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L118-L132
21,571
vmware/govmomi
vim25/xml/xml.go
NewDecoder
func NewDecoder(r io.Reader) *Decoder { d := &Decoder{ ns: make(map[string]string), nextByte: -1, line: 1, Strict: true, } d.switchToReader(r) return d }
go
func NewDecoder(r io.Reader) *Decoder { d := &Decoder{ ns: make(map[string]string), nextByte: -1, line: 1, Strict: true, } d.switchToReader(r) return d }
[ "func", "NewDecoder", "(", "r", "io", ".", "Reader", ")", "*", "Decoder", "{", "d", ":=", "&", "Decoder", "{", "ns", ":", "make", "(", "map", "[", "string", "]", "string", ")", ",", "nextByte", ":", "-", "1", ",", "line", ":", "1", ",", "Strict...
// NewDecoder creates a new XML parser reading from r. // If r does not implement io.ByteReader, NewDecoder will // do its own buffering.
[ "NewDecoder", "creates", "a", "new", "XML", "parser", "reading", "from", "r", ".", "If", "r", "does", "not", "implement", "io", ".", "ByteReader", "NewDecoder", "will", "do", "its", "own", "buffering", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L209-L218
21,572
vmware/govmomi
vim25/xml/xml.go
popEOF
func (d *Decoder) popEOF() bool { if d.stk == nil || d.stk.kind != stkEOF { return false } d.pop() return true }
go
func (d *Decoder) popEOF() bool { if d.stk == nil || d.stk.kind != stkEOF { return false } d.pop() return true }
[ "func", "(", "d", "*", "Decoder", ")", "popEOF", "(", ")", "bool", "{", "if", "d", ".", "stk", "==", "nil", "||", "d", ".", "stk", ".", "kind", "!=", "stkEOF", "{", "return", "false", "\n", "}", "\n", "d", ".", "pop", "(", ")", "\n", "return"...
// Undo a pushEOF. // The element must have been finished, so the EOF should be at the top of the stack.
[ "Undo", "a", "pushEOF", ".", "The", "element", "must", "have", "been", "finished", "so", "the", "EOF", "should", "be", "at", "the", "top", "of", "the", "stack", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L401-L407
21,573
vmware/govmomi
vim25/xml/xml.go
pushElement
func (d *Decoder) pushElement(name Name) { s := d.push(stkStart) s.name = name }
go
func (d *Decoder) pushElement(name Name) { s := d.push(stkStart) s.name = name }
[ "func", "(", "d", "*", "Decoder", ")", "pushElement", "(", "name", "Name", ")", "{", "s", ":=", "d", ".", "push", "(", "stkStart", ")", "\n", "s", ".", "name", "=", "name", "\n", "}" ]
// Record that we are starting an element with the given name.
[ "Record", "that", "we", "are", "starting", "an", "element", "with", "the", "given", "name", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L410-L413
21,574
vmware/govmomi
vim25/xml/xml.go
syntaxError
func (d *Decoder) syntaxError(msg string) error { return &SyntaxError{Msg: msg, Line: d.line} }
go
func (d *Decoder) syntaxError(msg string) error { return &SyntaxError{Msg: msg, Line: d.line} }
[ "func", "(", "d", "*", "Decoder", ")", "syntaxError", "(", "msg", "string", ")", "error", "{", "return", "&", "SyntaxError", "{", "Msg", ":", "msg", ",", "Line", ":", "d", ".", "line", "}", "\n", "}" ]
// Creates a SyntaxError with the current line number.
[ "Creates", "a", "SyntaxError", "with", "the", "current", "line", "number", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L425-L427
21,575
vmware/govmomi
vim25/xml/xml.go
popElement
func (d *Decoder) popElement(t *EndElement) bool { s := d.pop() name := t.Name switch { case s == nil || s.kind != stkStart: d.err = d.syntaxError("unexpected end element </" + name.Local + ">") return false case s.name.Local != name.Local: if !d.Strict { d.needClose = true d.toClose = t.Name t.Name...
go
func (d *Decoder) popElement(t *EndElement) bool { s := d.pop() name := t.Name switch { case s == nil || s.kind != stkStart: d.err = d.syntaxError("unexpected end element </" + name.Local + ">") return false case s.name.Local != name.Local: if !d.Strict { d.needClose = true d.toClose = t.Name t.Name...
[ "func", "(", "d", "*", "Decoder", ")", "popElement", "(", "t", "*", "EndElement", ")", "bool", "{", "s", ":=", "d", ".", "pop", "(", ")", "\n", "name", ":=", "t", ".", "Name", "\n", "switch", "{", "case", "s", "==", "nil", "||", "s", ".", "ki...
// Record that we are ending an element with the given name. // The name must match the record at the top of the stack, // which must be a pushElement record. // After popping the element, apply any undo records from // the stack to restore the name translations that existed // before we saw this element.
[ "Record", "that", "we", "are", "ending", "an", "element", "with", "the", "given", "name", ".", "The", "name", "must", "match", "the", "record", "at", "the", "top", "of", "the", "stack", "which", "must", "be", "a", "pushElement", "record", ".", "After", ...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L435-L469
21,576
vmware/govmomi
vim25/xml/xml.go
autoClose
func (d *Decoder) autoClose(t Token) (Token, bool) { if d.stk == nil || d.stk.kind != stkStart { return nil, false } name := strings.ToLower(d.stk.name.Local) for _, s := range d.AutoClose { if strings.ToLower(s) == name { // This one should be auto closed if t doesn't close it. et, ok := t.(EndElement) ...
go
func (d *Decoder) autoClose(t Token) (Token, bool) { if d.stk == nil || d.stk.kind != stkStart { return nil, false } name := strings.ToLower(d.stk.name.Local) for _, s := range d.AutoClose { if strings.ToLower(s) == name { // This one should be auto closed if t doesn't close it. et, ok := t.(EndElement) ...
[ "func", "(", "d", "*", "Decoder", ")", "autoClose", "(", "t", "Token", ")", "(", "Token", ",", "bool", ")", "{", "if", "d", ".", "stk", "==", "nil", "||", "d", ".", "stk", ".", "kind", "!=", "stkStart", "{", "return", "nil", ",", "false", "\n",...
// If the top element on the stack is autoclosing and // t is not the end tag, invent the end tag.
[ "If", "the", "top", "element", "on", "the", "stack", "is", "autoclosing", "and", "t", "is", "not", "the", "end", "tag", "invent", "the", "end", "tag", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L473-L489
21,577
vmware/govmomi
vim25/xml/xml.go
RawToken
func (d *Decoder) RawToken() (Token, error) { if d.unmarshalDepth > 0 { return nil, errRawToken } return d.rawToken() }
go
func (d *Decoder) RawToken() (Token, error) { if d.unmarshalDepth > 0 { return nil, errRawToken } return d.rawToken() }
[ "func", "(", "d", "*", "Decoder", ")", "RawToken", "(", ")", "(", "Token", ",", "error", ")", "{", "if", "d", ".", "unmarshalDepth", ">", "0", "{", "return", "nil", ",", "errRawToken", "\n", "}", "\n", "return", "d", ".", "rawToken", "(", ")", "\...
// RawToken is like Token but does not verify that // start and end elements match and does not translate // name space prefixes to their corresponding URLs.
[ "RawToken", "is", "like", "Token", "but", "does", "not", "verify", "that", "start", "and", "end", "elements", "match", "and", "does", "not", "translate", "name", "space", "prefixes", "to", "their", "corresponding", "URLs", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L496-L501
21,578
vmware/govmomi
vim25/xml/xml.go
space
func (d *Decoder) space() { for { b, ok := d.getc() if !ok { return } switch b { case ' ', '\r', '\n', '\t': default: d.ungetc(b) return } } }
go
func (d *Decoder) space() { for { b, ok := d.getc() if !ok { return } switch b { case ' ', '\r', '\n', '\t': default: d.ungetc(b) return } } }
[ "func", "(", "d", "*", "Decoder", ")", "space", "(", ")", "{", "for", "{", "b", ",", "ok", ":=", "d", ".", "getc", "(", ")", "\n", "if", "!", "ok", "{", "return", "\n", "}", "\n", "switch", "b", "{", "case", "' '", ",", "'\\r'", ",", "'\\n'...
// Skip spaces if any
[ "Skip", "spaces", "if", "any" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L828-L841
21,579
vmware/govmomi
vim25/xml/xml.go
getc
func (d *Decoder) getc() (b byte, ok bool) { if d.err != nil { return 0, false } if d.nextByte >= 0 { b = byte(d.nextByte) d.nextByte = -1 } else { b, d.err = d.r.ReadByte() if d.err != nil { return 0, false } if d.saved != nil { d.saved.WriteByte(b) } } if b == '\n' { d.line++ } return ...
go
func (d *Decoder) getc() (b byte, ok bool) { if d.err != nil { return 0, false } if d.nextByte >= 0 { b = byte(d.nextByte) d.nextByte = -1 } else { b, d.err = d.r.ReadByte() if d.err != nil { return 0, false } if d.saved != nil { d.saved.WriteByte(b) } } if b == '\n' { d.line++ } return ...
[ "func", "(", "d", "*", "Decoder", ")", "getc", "(", ")", "(", "b", "byte", ",", "ok", "bool", ")", "{", "if", "d", ".", "err", "!=", "nil", "{", "return", "0", ",", "false", "\n", "}", "\n", "if", "d", ".", "nextByte", ">=", "0", "{", "b", ...
// Read a single byte. // If there is no byte to read, return ok==false // and leave the error in d.err. // Maintain line number.
[ "Read", "a", "single", "byte", ".", "If", "there", "is", "no", "byte", "to", "read", "return", "ok", "==", "false", "and", "leave", "the", "error", "in", "d", ".", "err", ".", "Maintain", "line", "number", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L847-L867
21,580
vmware/govmomi
vim25/xml/xml.go
readName
func (d *Decoder) readName() (ok bool) { var b byte if b, ok = d.mustgetc(); !ok { return } if b < utf8.RuneSelf && !isNameByte(b) { d.ungetc(b) return false } d.buf.WriteByte(b) for { if b, ok = d.mustgetc(); !ok { return } if b < utf8.RuneSelf && !isNameByte(b) { d.ungetc(b) break } d...
go
func (d *Decoder) readName() (ok bool) { var b byte if b, ok = d.mustgetc(); !ok { return } if b < utf8.RuneSelf && !isNameByte(b) { d.ungetc(b) return false } d.buf.WriteByte(b) for { if b, ok = d.mustgetc(); !ok { return } if b < utf8.RuneSelf && !isNameByte(b) { d.ungetc(b) break } d...
[ "func", "(", "d", "*", "Decoder", ")", "readName", "(", ")", "(", "ok", "bool", ")", "{", "var", "b", "byte", "\n", "if", "b", ",", "ok", "=", "d", ".", "mustgetc", "(", ")", ";", "!", "ok", "{", "return", "\n", "}", "\n", "if", "b", "<", ...
// Read a name and append its bytes to d.buf. // The name is delimited by any single-byte character not valid in names. // All multi-byte characters are accepted; the caller must check their validity.
[ "Read", "a", "name", "and", "append", "its", "bytes", "to", "d", ".", "buf", ".", "The", "name", "is", "delimited", "by", "any", "single", "-", "byte", "character", "not", "valid", "in", "names", ".", "All", "multi", "-", "byte", "characters", "are", ...
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L1127-L1149
21,581
vmware/govmomi
vim25/xml/xml.go
procInstEncoding
func procInstEncoding(s string) string { // TODO: this parsing is somewhat lame and not exact. // It works for all actual cases, though. idx := strings.Index(s, "encoding=") if idx == -1 { return "" } v := s[idx+len("encoding="):] if v == "" { return "" } if v[0] != '\'' && v[0] != '"' { return "" } id...
go
func procInstEncoding(s string) string { // TODO: this parsing is somewhat lame and not exact. // It works for all actual cases, though. idx := strings.Index(s, "encoding=") if idx == -1 { return "" } v := s[idx+len("encoding="):] if v == "" { return "" } if v[0] != '\'' && v[0] != '"' { return "" } id...
[ "func", "procInstEncoding", "(", "s", "string", ")", "string", "{", "// TODO: this parsing is somewhat lame and not exact.", "// It works for all actual cases, though.", "idx", ":=", "strings", ".", "Index", "(", "s", ",", "\"", "\"", ")", "\n", "if", "idx", "==", "...
// procInstEncoding parses the `encoding="..."` or `encoding='...'` // value out of the provided string, returning "" if not found.
[ "procInstEncoding", "parses", "the", "encoding", "=", "...", "or", "encoding", "=", "...", "value", "out", "of", "the", "provided", "string", "returning", "if", "not", "found", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vim25/xml/xml.go#L1920-L1939
21,582
vmware/govmomi
object/distributed_virtual_portgroup.go
EthernetCardBackingInfo
func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { var dvp mo.DistributedVirtualPortgroup var dvs mo.DistributedVirtualSwitch prop := "config.distributedVirtualSwitch" if err := p.Properties(ctx, p.Reference(), []string{"key", prop}, &dvp...
go
func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { var dvp mo.DistributedVirtualPortgroup var dvs mo.DistributedVirtualSwitch prop := "config.distributedVirtualSwitch" if err := p.Properties(ctx, p.Reference(), []string{"key", prop}, &dvp...
[ "func", "(", "p", "DistributedVirtualPortgroup", ")", "EthernetCardBackingInfo", "(", "ctx", "context", ".", "Context", ")", "(", "types", ".", "BaseVirtualDeviceBackingInfo", ",", "error", ")", "{", "var", "dvp", "mo", ".", "DistributedVirtualPortgroup", "\n", "v...
// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this DistributedVirtualPortgroup
[ "EthernetCardBackingInfo", "returns", "the", "VirtualDeviceBackingInfo", "for", "this", "DistributedVirtualPortgroup" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/distributed_virtual_portgroup.go#L40-L66
21,583
vmware/govmomi
object/host_network_system.go
AddPortGroup
func (o HostNetworkSystem) AddPortGroup(ctx context.Context, portgrp types.HostPortGroupSpec) error { req := types.AddPortGroup{ This: o.Reference(), Portgrp: portgrp, } _, err := methods.AddPortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) AddPortGroup(ctx context.Context, portgrp types.HostPortGroupSpec) error { req := types.AddPortGroup{ This: o.Reference(), Portgrp: portgrp, } _, err := methods.AddPortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "AddPortGroup", "(", "ctx", "context", ".", "Context", ",", "portgrp", "types", ".", "HostPortGroupSpec", ")", "error", "{", "req", ":=", "types", ".", "AddPortGroup", "{", "This", ":", "o", ".", "Reference", "("...
// AddPortGroup wraps methods.AddPortGroup
[ "AddPortGroup", "wraps", "methods", ".", "AddPortGroup" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L38-L50
21,584
vmware/govmomi
object/host_network_system.go
AddServiceConsoleVirtualNic
func (o HostNetworkSystem) AddServiceConsoleVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { req := types.AddServiceConsoleVirtualNic{ This: o.Reference(), Portgroup: portgroup, Nic: nic, } res, err := methods.AddServiceConsoleVirtualNic(ctx, o.c, &r...
go
func (o HostNetworkSystem) AddServiceConsoleVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { req := types.AddServiceConsoleVirtualNic{ This: o.Reference(), Portgroup: portgroup, Nic: nic, } res, err := methods.AddServiceConsoleVirtualNic(ctx, o.c, &r...
[ "func", "(", "o", "HostNetworkSystem", ")", "AddServiceConsoleVirtualNic", "(", "ctx", "context", ".", "Context", ",", "portgroup", "string", ",", "nic", "types", ".", "HostVirtualNicSpec", ")", "(", "string", ",", "error", ")", "{", "req", ":=", "types", "....
// AddServiceConsoleVirtualNic wraps methods.AddServiceConsoleVirtualNic
[ "AddServiceConsoleVirtualNic", "wraps", "methods", ".", "AddServiceConsoleVirtualNic" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L53-L66
21,585
vmware/govmomi
object/host_network_system.go
AddVirtualSwitch
func (o HostNetworkSystem) AddVirtualSwitch(ctx context.Context, vswitchName string, spec *types.HostVirtualSwitchSpec) error { req := types.AddVirtualSwitch{ This: o.Reference(), VswitchName: vswitchName, Spec: spec, } _, err := methods.AddVirtualSwitch(ctx, o.c, &req) if err != nil { return...
go
func (o HostNetworkSystem) AddVirtualSwitch(ctx context.Context, vswitchName string, spec *types.HostVirtualSwitchSpec) error { req := types.AddVirtualSwitch{ This: o.Reference(), VswitchName: vswitchName, Spec: spec, } _, err := methods.AddVirtualSwitch(ctx, o.c, &req) if err != nil { return...
[ "func", "(", "o", "HostNetworkSystem", ")", "AddVirtualSwitch", "(", "ctx", "context", ".", "Context", ",", "vswitchName", "string", ",", "spec", "*", "types", ".", "HostVirtualSwitchSpec", ")", "error", "{", "req", ":=", "types", ".", "AddVirtualSwitch", "{",...
// AddVirtualSwitch wraps methods.AddVirtualSwitch
[ "AddVirtualSwitch", "wraps", "methods", ".", "AddVirtualSwitch" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L85-L98
21,586
vmware/govmomi
object/host_network_system.go
QueryNetworkHint
func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) error { req := types.QueryNetworkHint{ This: o.Reference(), Device: device, } _, err := methods.QueryNetworkHint(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) error { req := types.QueryNetworkHint{ This: o.Reference(), Device: device, } _, err := methods.QueryNetworkHint(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "QueryNetworkHint", "(", "ctx", "context", ".", "Context", ",", "device", "[", "]", "string", ")", "error", "{", "req", ":=", "types", ".", "QueryNetworkHint", "{", "This", ":", "o", ".", "Reference", "(", ")",...
// QueryNetworkHint wraps methods.QueryNetworkHint
[ "QueryNetworkHint", "wraps", "methods", ".", "QueryNetworkHint" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L101-L113
21,587
vmware/govmomi
object/host_network_system.go
RefreshNetworkSystem
func (o HostNetworkSystem) RefreshNetworkSystem(ctx context.Context) error { req := types.RefreshNetworkSystem{ This: o.Reference(), } _, err := methods.RefreshNetworkSystem(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) RefreshNetworkSystem(ctx context.Context) error { req := types.RefreshNetworkSystem{ This: o.Reference(), } _, err := methods.RefreshNetworkSystem(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "RefreshNetworkSystem", "(", "ctx", "context", ".", "Context", ")", "error", "{", "req", ":=", "types", ".", "RefreshNetworkSystem", "{", "This", ":", "o", ".", "Reference", "(", ")", ",", "}", "\n\n", "_", ","...
// RefreshNetworkSystem wraps methods.RefreshNetworkSystem
[ "RefreshNetworkSystem", "wraps", "methods", ".", "RefreshNetworkSystem" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L116-L127
21,588
vmware/govmomi
object/host_network_system.go
RemovePortGroup
func (o HostNetworkSystem) RemovePortGroup(ctx context.Context, pgName string) error { req := types.RemovePortGroup{ This: o.Reference(), PgName: pgName, } _, err := methods.RemovePortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) RemovePortGroup(ctx context.Context, pgName string) error { req := types.RemovePortGroup{ This: o.Reference(), PgName: pgName, } _, err := methods.RemovePortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "RemovePortGroup", "(", "ctx", "context", ".", "Context", ",", "pgName", "string", ")", "error", "{", "req", ":=", "types", ".", "RemovePortGroup", "{", "This", ":", "o", ".", "Reference", "(", ")", ",", "PgNam...
// RemovePortGroup wraps methods.RemovePortGroup
[ "RemovePortGroup", "wraps", "methods", ".", "RemovePortGroup" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L130-L142
21,589
vmware/govmomi
object/host_network_system.go
RemoveVirtualSwitch
func (o HostNetworkSystem) RemoveVirtualSwitch(ctx context.Context, vswitchName string) error { req := types.RemoveVirtualSwitch{ This: o.Reference(), VswitchName: vswitchName, } _, err := methods.RemoveVirtualSwitch(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) RemoveVirtualSwitch(ctx context.Context, vswitchName string) error { req := types.RemoveVirtualSwitch{ This: o.Reference(), VswitchName: vswitchName, } _, err := methods.RemoveVirtualSwitch(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "RemoveVirtualSwitch", "(", "ctx", "context", ".", "Context", ",", "vswitchName", "string", ")", "error", "{", "req", ":=", "types", ".", "RemoveVirtualSwitch", "{", "This", ":", "o", ".", "Reference", "(", ")", ...
// RemoveVirtualSwitch wraps methods.RemoveVirtualSwitch
[ "RemoveVirtualSwitch", "wraps", "methods", ".", "RemoveVirtualSwitch" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L175-L187
21,590
vmware/govmomi
object/host_network_system.go
UpdateConsoleIpRouteConfig
func (o HostNetworkSystem) UpdateConsoleIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { req := types.UpdateConsoleIpRouteConfig{ This: o.Reference(), Config: config, } _, err := methods.UpdateConsoleIpRouteConfig(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) UpdateConsoleIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { req := types.UpdateConsoleIpRouteConfig{ This: o.Reference(), Config: config, } _, err := methods.UpdateConsoleIpRouteConfig(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "UpdateConsoleIpRouteConfig", "(", "ctx", "context", ".", "Context", ",", "config", "types", ".", "BaseHostIpRouteConfig", ")", "error", "{", "req", ":=", "types", ".", "UpdateConsoleIpRouteConfig", "{", "This", ":", "...
// UpdateConsoleIpRouteConfig wraps methods.UpdateConsoleIpRouteConfig
[ "UpdateConsoleIpRouteConfig", "wraps", "methods", ".", "UpdateConsoleIpRouteConfig" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L205-L217
21,591
vmware/govmomi
object/host_network_system.go
UpdateNetworkConfig
func (o HostNetworkSystem) UpdateNetworkConfig(ctx context.Context, config types.HostNetworkConfig, changeMode string) (*types.HostNetworkConfigResult, error) { req := types.UpdateNetworkConfig{ This: o.Reference(), Config: config, ChangeMode: changeMode, } res, err := methods.UpdateNetworkConfig(ct...
go
func (o HostNetworkSystem) UpdateNetworkConfig(ctx context.Context, config types.HostNetworkConfig, changeMode string) (*types.HostNetworkConfigResult, error) { req := types.UpdateNetworkConfig{ This: o.Reference(), Config: config, ChangeMode: changeMode, } res, err := methods.UpdateNetworkConfig(ct...
[ "func", "(", "o", "HostNetworkSystem", ")", "UpdateNetworkConfig", "(", "ctx", "context", ".", "Context", ",", "config", "types", ".", "HostNetworkConfig", ",", "changeMode", "string", ")", "(", "*", "types", ".", "HostNetworkConfigResult", ",", "error", ")", ...
// UpdateNetworkConfig wraps methods.UpdateNetworkConfig
[ "UpdateNetworkConfig", "wraps", "methods", ".", "UpdateNetworkConfig" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L265-L278
21,592
vmware/govmomi
object/host_network_system.go
UpdatePhysicalNicLinkSpeed
func (o HostNetworkSystem) UpdatePhysicalNicLinkSpeed(ctx context.Context, device string, linkSpeed *types.PhysicalNicLinkInfo) error { req := types.UpdatePhysicalNicLinkSpeed{ This: o.Reference(), Device: device, LinkSpeed: linkSpeed, } _, err := methods.UpdatePhysicalNicLinkSpeed(ctx, o.c, &req) if...
go
func (o HostNetworkSystem) UpdatePhysicalNicLinkSpeed(ctx context.Context, device string, linkSpeed *types.PhysicalNicLinkInfo) error { req := types.UpdatePhysicalNicLinkSpeed{ This: o.Reference(), Device: device, LinkSpeed: linkSpeed, } _, err := methods.UpdatePhysicalNicLinkSpeed(ctx, o.c, &req) if...
[ "func", "(", "o", "HostNetworkSystem", ")", "UpdatePhysicalNicLinkSpeed", "(", "ctx", "context", ".", "Context", ",", "device", "string", ",", "linkSpeed", "*", "types", ".", "PhysicalNicLinkInfo", ")", "error", "{", "req", ":=", "types", ".", "UpdatePhysicalNic...
// UpdatePhysicalNicLinkSpeed wraps methods.UpdatePhysicalNicLinkSpeed
[ "UpdatePhysicalNicLinkSpeed", "wraps", "methods", ".", "UpdatePhysicalNicLinkSpeed" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L281-L294
21,593
vmware/govmomi
object/host_network_system.go
UpdatePortGroup
func (o HostNetworkSystem) UpdatePortGroup(ctx context.Context, pgName string, portgrp types.HostPortGroupSpec) error { req := types.UpdatePortGroup{ This: o.Reference(), PgName: pgName, Portgrp: portgrp, } _, err := methods.UpdatePortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) UpdatePortGroup(ctx context.Context, pgName string, portgrp types.HostPortGroupSpec) error { req := types.UpdatePortGroup{ This: o.Reference(), PgName: pgName, Portgrp: portgrp, } _, err := methods.UpdatePortGroup(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "UpdatePortGroup", "(", "ctx", "context", ".", "Context", ",", "pgName", "string", ",", "portgrp", "types", ".", "HostPortGroupSpec", ")", "error", "{", "req", ":=", "types", ".", "UpdatePortGroup", "{", "This", ":...
// UpdatePortGroup wraps methods.UpdatePortGroup
[ "UpdatePortGroup", "wraps", "methods", ".", "UpdatePortGroup" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L297-L310
21,594
vmware/govmomi
object/host_network_system.go
UpdateVirtualNic
func (o HostNetworkSystem) UpdateVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { req := types.UpdateVirtualNic{ This: o.Reference(), Device: device, Nic: nic, } _, err := methods.UpdateVirtualNic(ctx, o.c, &req) if err != nil { return err } return nil }
go
func (o HostNetworkSystem) UpdateVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { req := types.UpdateVirtualNic{ This: o.Reference(), Device: device, Nic: nic, } _, err := methods.UpdateVirtualNic(ctx, o.c, &req) if err != nil { return err } return nil }
[ "func", "(", "o", "HostNetworkSystem", ")", "UpdateVirtualNic", "(", "ctx", "context", ".", "Context", ",", "device", "string", ",", "nic", "types", ".", "HostVirtualNicSpec", ")", "error", "{", "req", ":=", "types", ".", "UpdateVirtualNic", "{", "This", ":"...
// UpdateVirtualNic wraps methods.UpdateVirtualNic
[ "UpdateVirtualNic", "wraps", "methods", ".", "UpdateVirtualNic" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/object/host_network_system.go#L329-L342
21,595
vmware/govmomi
view/task_view.go
CreateTaskView
func (m Manager) CreateTaskView(ctx context.Context, watch *types.ManagedObjectReference) (*TaskView, error) { l, err := m.CreateListView(ctx, nil) if err != nil { return nil, err } tv := &TaskView{ ListView: l, Watch: watch, } return tv, nil }
go
func (m Manager) CreateTaskView(ctx context.Context, watch *types.ManagedObjectReference) (*TaskView, error) { l, err := m.CreateListView(ctx, nil) if err != nil { return nil, err } tv := &TaskView{ ListView: l, Watch: watch, } return tv, nil }
[ "func", "(", "m", "Manager", ")", "CreateTaskView", "(", "ctx", "context", ".", "Context", ",", "watch", "*", "types", ".", "ManagedObjectReference", ")", "(", "*", "TaskView", ",", "error", ")", "{", "l", ",", "err", ":=", "m", ".", "CreateListView", ...
// CreateTaskView creates a new ListView that optionally watches for a ManagedEntity's recentTask updates.
[ "CreateTaskView", "creates", "a", "new", "ListView", "that", "optionally", "watches", "for", "a", "ManagedEntity", "s", "recentTask", "updates", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/view/task_view.go#L36-L48
21,596
vmware/govmomi
view/task_view.go
Collect
func (v TaskView) Collect(ctx context.Context, f func([]types.TaskInfo)) error { // Using TaskHistoryCollector would be less clunky, but it isn't supported on ESX at all. ref := v.Reference() filter := new(property.WaitFilter).Add(ref, "Task", []string{"info"}, v.TraversalSpec()) if v.Watch != nil { filter.Add(*...
go
func (v TaskView) Collect(ctx context.Context, f func([]types.TaskInfo)) error { // Using TaskHistoryCollector would be less clunky, but it isn't supported on ESX at all. ref := v.Reference() filter := new(property.WaitFilter).Add(ref, "Task", []string{"info"}, v.TraversalSpec()) if v.Watch != nil { filter.Add(*...
[ "func", "(", "v", "TaskView", ")", "Collect", "(", "ctx", "context", ".", "Context", ",", "f", "func", "(", "[", "]", "types", ".", "TaskInfo", ")", ")", "error", "{", "// Using TaskHistoryCollector would be less clunky, but it isn't supported on ESX at all.", "ref"...
// Collect calls function f for each Task update.
[ "Collect", "calls", "function", "f", "for", "each", "Task", "update", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/view/task_view.go#L51-L125
21,597
vmware/govmomi
vapi/vcenter/vcenter_ovf.go
DeployLibraryItem
func (c *Manager) DeployLibraryItem(ctx context.Context, libraryItemID string, deploy Deploy) (Deployment, error) { url := internal.URL(c, internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("deploy") var res Deployment return res, c.Do(ctx, url.Request(http.MethodPost, deploy), &res) }
go
func (c *Manager) DeployLibraryItem(ctx context.Context, libraryItemID string, deploy Deploy) (Deployment, error) { url := internal.URL(c, internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("deploy") var res Deployment return res, c.Do(ctx, url.Request(http.MethodPost, deploy), &res) }
[ "func", "(", "c", "*", "Manager", ")", "DeployLibraryItem", "(", "ctx", "context", ".", "Context", ",", "libraryItemID", "string", ",", "deploy", "Deploy", ")", "(", "Deployment", ",", "error", ")", "{", "url", ":=", "internal", ".", "URL", "(", "c", "...
// DeployLibraryItem deploys a library OVF
[ "DeployLibraryItem", "deploys", "a", "library", "OVF" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/vcenter/vcenter_ovf.go#L141-L145
21,598
vmware/govmomi
vapi/vcenter/vcenter_ovf.go
FilterLibraryItem
func (c *Manager) FilterLibraryItem(ctx context.Context, libraryItemID string, filter FilterRequest) (FilterResponse, error) { url := internal.URL(c, internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("filter") var res FilterResponse return res, c.Do(ctx, url.Request(http.MethodPost, filter), &res) }
go
func (c *Manager) FilterLibraryItem(ctx context.Context, libraryItemID string, filter FilterRequest) (FilterResponse, error) { url := internal.URL(c, internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("filter") var res FilterResponse return res, c.Do(ctx, url.Request(http.MethodPost, filter), &res) }
[ "func", "(", "c", "*", "Manager", ")", "FilterLibraryItem", "(", "ctx", "context", ".", "Context", ",", "libraryItemID", "string", ",", "filter", "FilterRequest", ")", "(", "FilterResponse", ",", "error", ")", "{", "url", ":=", "internal", ".", "URL", "(",...
// FilterLibraryItem deploys a library OVF
[ "FilterLibraryItem", "deploys", "a", "library", "OVF" ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/vcenter/vcenter_ovf.go#L148-L152
21,599
vmware/govmomi
vapi/rest/client.go
NewClient
func NewClient(c *vim25.Client) *Client { sc := c.Client.NewServiceClient(internal.Path, "") return &Client{sc} }
go
func NewClient(c *vim25.Client) *Client { sc := c.Client.NewServiceClient(internal.Path, "") return &Client{sc} }
[ "func", "NewClient", "(", "c", "*", "vim25", ".", "Client", ")", "*", "Client", "{", "sc", ":=", "c", ".", "Client", ".", "NewServiceClient", "(", "internal", ".", "Path", ",", "\"", "\"", ")", "\n\n", "return", "&", "Client", "{", "sc", "}", "\n",...
// NewClient creates a new Client instance.
[ "NewClient", "creates", "a", "new", "Client", "instance", "." ]
fc3f0e9d2275df0e497a80917807a7c72d3c35bc
https://github.com/vmware/govmomi/blob/fc3f0e9d2275df0e497a80917807a7c72d3c35bc/vapi/rest/client.go#L40-L44