November 23, 2017


Un-share an image template

The script un-shares an image template it makes a call to  SoftLayer_Virtual_Guest_Block_Device_Template_Group::denySharingAccess
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 remove sharing access
	imageId := 879951

	// The account you wish to remove sharing access
	accountToShare := 207819

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

	// Get SoftLayer_Virtual_Guest_Block_Device_Template_Group service.
  	service := services.GetVirtualGuestBlockDeviceTemplateGroupService(sess)

	// Un-share the image.
  	result, err := service.Id(imageId).DenySharingAccess(&accountToShare)
	if err != nil {
		fmt.Printf("\n Unable to remove sharing access:\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