This commit is contained in:
31
main.go
31
main.go
@@ -184,24 +184,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error {
|
|||||||
|
|
||||||
func generateBusSharingTable() string {
|
func generateBusSharingTable() string {
|
||||||
// Define the HTML template
|
// Define the HTML template
|
||||||
htmlTemplate := `
|
htmlTemplate := `<table><tbody><tr><th>Vm Name</th><th>Cluster Name</th><th>Controller Name</th><th>Sharing Type</th></tr>{{range .}}<tr><td>{{.VmName}}</td><td>{{.ClusterName}}</td><td>{{.ControllerName}}</td><td>{{.SharingType}}</td></tr>{{end}}</tbody></table>`
|
||||||
<table><tbody>
|
|
||||||
<tr>
|
|
||||||
<th>Vm Name</th>
|
|
||||||
<th>Cluster Name</th>
|
|
||||||
<th>Controller Name</th>
|
|
||||||
<th>Sharing Type</th>
|
|
||||||
</tr>
|
|
||||||
{{range .}}
|
|
||||||
<tr>
|
|
||||||
<td>{{.VmName}}</td>
|
|
||||||
<td>{{.ClusterName}}</td>
|
|
||||||
<td>{{.ControllerName}}</td>
|
|
||||||
<td>{{.SharingType}}</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
</tbody></table>
|
|
||||||
`
|
|
||||||
|
|
||||||
// Create a new template and parse the HTML template
|
// Create a new template and parse the HTML template
|
||||||
tmpl := template.Must(template.New("table").Parse(htmlTemplate))
|
tmpl := template.Must(template.New("table").Parse(htmlTemplate))
|
||||||
@@ -368,20 +351,20 @@ func main() {
|
|||||||
fmt.Printf("New Content: %v\n", newContent)
|
fmt.Printf("New Content: %v\n", newContent)
|
||||||
|
|
||||||
data := &goconfluence.Content{
|
data := &goconfluence.Content{
|
||||||
ID: c.ID,
|
ID: *cPageId,
|
||||||
Type: c.Type,
|
Type: "page",
|
||||||
Title: c.Title,
|
Title: "VMs with SCSI Bus Sharing",
|
||||||
Body: goconfluence.Body{
|
Body: goconfluence.Body{
|
||||||
Storage: goconfluence.Storage{
|
Storage: goconfluence.Storage{
|
||||||
Value: newContent,
|
Value: newContent,
|
||||||
Representation: c.Body.Storage.Representation,
|
Representation: "storage",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Version: &goconfluence.Version{
|
Version: &goconfluence.Version{
|
||||||
Number: 3,
|
Number: 6,
|
||||||
},
|
},
|
||||||
Space: &goconfluence.Space{
|
Space: &goconfluence.Space{
|
||||||
Key: c.Space.Key,
|
Key: *cSpaceKey,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
//c.Body.Storage.Value = newContent
|
//c.Body.Storage.Value = newContent
|
||||||
|
Reference in New Issue
Block a user