This example shows how to create an empty library item that stores an ISO image file.
This example uses the steps that are described in the Create an Empty Library Item procedure.
use Com::Vmware::Content::Library; use Data::GUID; # 1 - Create an instance of the ItemModel class to specify the item settings. my $item_model = new Com::Vmware::Content::Library::ItemModel(); $item_model->set_name('ESXi ISO image'); $item_model->set_description( 'ISO image with atest security patches for ESXi 5.5 as of 2/3/2015'); $item_model->set_type('iso'); # 2 - Associate the new item with an existing library. $item_model->set_library_id($my_library_id); # 3 - Create the new instance of the Item class, using the specified model. my $idem_token = Data::GUID->guid_string; my $item_stub = new Com::Vmware::Content::Library::ItemService($my_stub_config); $my_item_id = $item_stub->create(create_spec => $item_model, client_token => $idem_token);