November 23, 2017


Share image template.

The script shares an image template to another account, it makes a single call to
SoftLayer_Virtual_Guest_Block_Device_Template_Group::permitSharingAccess method.
For more information please see below.

Important manual pages

Author: SoftLayer Technologies, Inc. <>
package main

import (

func main() {
	// SoftLayer API username and key.
	username  := "set me"
	apikey    := "set me"

  	// The image id you wish to share
	imageId := 879951

	// The account you wish to share the image template
	accountToShare := 207819

	// Create session
  	sess := session.New(username, apikey)

	// Get SoftLayer_Virtual_Guest_Block_Device_Template_Group service.
  	service := services.GetVirtualGuestBlockDeviceTemplateGroupService(sess)
	// Share the image to specified account.
  	result, err := service.Id(imageId).PermitSharingAccess(&accountToShare)
	if err != nil {
		fmt.Printf("\n Unable to share the image:\n - %s\n", err)

	// Print result


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue