{"id":37102002,"url":"https://github.com/2spmohanty/gosphere","last_synced_at":"2026-01-14T12:22:15.414Z","repository":{"id":57507394,"uuid":"184450625","full_name":"2spmohanty/gosphere","owner":"2spmohanty","description":"vCenter Automation GO way.","archived":false,"fork":false,"pushed_at":"2022-03-02T23:24:53.000Z","size":38012,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T07:52:32.451Z","etag":null,"topics":["automation","golang","govmomi","vcenter","vmware","vmware-vsphere","vsphere","vsphere-api","vsphere-sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2spmohanty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-01T17:02:33.000Z","updated_at":"2025-02-17T11:06:59.000Z","dependencies_parsed_at":"2022-09-26T18:31:31.243Z","dependency_job_id":null,"html_url":"https://github.com/2spmohanty/gosphere","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/2spmohanty/gosphere","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2spmohanty%2Fgosphere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2spmohanty%2Fgosphere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2spmohanty%2Fgosphere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2spmohanty%2Fgosphere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2spmohanty","download_url":"https://codeload.github.com/2spmohanty/gosphere/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2spmohanty%2Fgosphere/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","golang","govmomi","vcenter","vmware","vmware-vsphere","vsphere","vsphere-api","vsphere-sdk"],"created_at":"2026-01-14T12:22:14.694Z","updated_at":"2026-01-14T12:22:15.387Z","avatar_url":"https://github.com/2spmohanty.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gosphere\nThe gosphere repository contains codes written in Go Language that can be used to perform automation task on VMWare vCenter. These codes are wrapper on govmomi and exposes easy Methods. Contributors are welcome.\n\n```\nfunc main() {\n\n\tvc := flag.String(\"vc\", \"VC_IP\", \"Enter vCenter IP/ FQDN\")\n\tuser := flag.String(\"user\", \"Administrator@vsphere.local\", \"vCenter User\")\n\tpass := flag.String(\"pass\", \"XXXXX\", \"Enter vCenter pass\")\n\tflag.Parse()\n\n\tvcenter := operation.NewVCenter(*vc, *user, *pass)\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\terr := vcenter.Connect(ctx)\n\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to connect to vCenter: %s\\n\", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Connected to vCenter: %s\\n\", *vc)\n\n\t//Get Datacenter Operation Level object\n\tdcops := operation.DatacenterOperation{Context: ctx, Vcenter: vcenter}\n\n\t//Get Cluster Operation Level object\n\tclops := operation.ClusterOperation{Context: ctx, Vcenter: vcenter}\n\n\tdatacenters, err := vcenter.GetAllDatacenter(ctx)\n\tif err != nil {\n\t\tfmt.Printf(\"Datacenters errors: %s\", err)\n\t\treturn\n\t}\n\n\tfor _, dc := range datacenters {\n\n\t\tdcName := dc.Name()\n\n\t\tfmt.Printf(\" Datacenter %s\\n\", dcName)\n\n\t\tstandalonehosts := dcops.GetStandAloneHosts(dc)\n\n\t\tif standalonehosts != nil {\n\t\t\tfmt.Printf(\"Standalone Hosts on Datacenter %s\\n\", dcName)\n\t\t\tfor _, hostmor := range standalonehosts {\n\t\t\t\tfmt.Println(hostmor.Name)\n\t\t\t}\n\t\t}\n\n\t\tvar cls []mo.ClusterComputeResource\n\n\t\tcls, _ = dcops.GetAllCluster(dc)\n\n\t\tif cls != nil {\n\n\t\t\tfor _, clsref := range cls {\n\n\t\t\t\tfmt.Printf(\"Datcenter Clusters ***** %s ******\\n\", clsref.Name)\n\n\t\t\t\tvar hosts []mo.HostSystem\n\t\t\t\thosts, _ = clops.GetAllClusterHosts(clsref, \"\")\n\n\t\t\t\tif hosts != nil {\n\t\t\t\t\tfmt.Printf(\"Cluster Hosts\")\n\t\t\t\t\tfor _, hostref := range hosts {\n\t\t\t\t\t\tfmt.Printf(\"**** %s ****\\n\", hostref.Name)\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n}\n```\n\n\n\n# Philosophy \n\n\nThe code must be \n\n```\n    - simple\n    - readable\n    - maintainable\n    - Do exactly one task.\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2spmohanty%2Fgosphere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2spmohanty%2Fgosphere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2spmohanty%2Fgosphere/lists"}