Для того, чтобы восстановить шаблоны публичных изображений вы можете использовать следующий метод:
SoftLayer_Virtual_Guest_Block_Device_Template_Group :: getPublicImages
Вы можете использовать этот метод с использованием Запрос REST таким образом:
https://$username:[email protected]/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getPublicImages.json
И это будет использование java-клиента.
/**
* This method gets all public image templates that the user is allowed to see.
*
* Important manual pages:
* @see http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getPublicImages
* @see http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_Block_Device_Template_Group
*
* @license <http://sldn.softlayer.com/wiki/index.php/License>
* @author SoftLayer Technologies, Inc. <[email protected]>
*/
package SoftLayer_Java_Scripts.Examples;
import com.softlayer.api.*;
import com.softlayer.api.service.virtual.guest.block.device.template.Group;
import java.util.List;
import com.google.gson.Gson;
public class GetPublicImages
{
public static void main(String[] args)
{
String user = "set me";
String apiKey = "set me";
ApiClient client = new RestApiClient().withCredentials(user, apiKey);
Group.Service service = Group.service(client);
try
{
List<Group> publicImages = service.getPublicImages();
Gson gson = new Gson();
for(Group image : publicImages) {
System.out.println(gson.toJson(image));
}
}
catch(Exception e)
{
System.out.println("Script failed, review the next message for further details: " + e);
}
}
}
Следующие ссылки предоставляют дополнительную информацию: http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getPublicImages
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_Block_Device_Template_Group
Спасибо Я работает .. –