func uploadLogs()

in nvidia-efa-ami_base/support/main.go [64:87]


func uploadLogs(client *support.Support, nvidialogs []string) (string, error) {
	// Read in attachments into memory
	attchs := make([]*support.Attachment, len(nvidialogs))
	for i, fp := range nvidialogs {
		attch := new(support.Attachment)
		data, err := os.ReadFile(fp)
		if err != nil {
			return "", err
		}
		attch.SetData(data)
		attch.SetFileName(filepath.Base(fp))
		attchs[i] = attch

	}

	// Upload attachments to support
	ats := new(support.AddAttachmentsToSetInput)
	ats.SetAttachments(attchs)
	resp, err := client.AddAttachmentsToSet(ats)
	if err != nil {
		return "", err
	}
	return *resp.AttachmentSetId, nil
}