Module: UU::ImageCatalog::ImageCatalog
- Extended by:
- ImageCatalog
- Included in:
- ImageCatalog
- Defined in:
- uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_create.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_exception.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_attributes.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_set_attributes.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_get_image_list.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_fatal_exception.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_import_catalog_data.rb,
uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog/image_catalog_image_entry_attributes.rb
Overview
Image catalog service.
Defined Under Namespace
Classes: ImageCatalogAttributes, ImageCatalogCreate, ImageCatalogException, ImageCatalogFatalException, ImageCatalogGetImageList, ImageCatalogImageEntryAttributes, ImageCatalogImportCatalogData, ImageCatalogSetAttributes
Constant Summary
- PATH =
Service path.
'uu/imagecatalog/ImageCatalog'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, catalog)
Creates specified image catalog.
-
- (Object) delete(catalog_uri)
Deletes the specified image catalog.
-
- (ImageCatalogAttributes) get_attributes(catalog_uri)
Returns attributes of the image catalog specified by the catalog URI.
-
- (UU::OS::REST::ResultList<ImageCatalog::ImageCatalogGetImageList, ImageCatalog::ImageCatalogImageEntryAttributes>) get_image_list(catalog_uri, criteria = nil)
Returns list of images from a catalog.
-
- (Object) import_catalog_data(catalog_uri, catalog_data)
Imports image catalog content data.
-
- (UESURI) set_attributes(catalog_uri, attrs)
Sets attributes of the image catalog specified by the catalog URI.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, catalog)
Creates specified image catalog.
28 29 30 31 32 33 34 35 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 28 def create(location_uri, catalog) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) payload = ImageCatalogCreate.new(catalog).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) delete(catalog_uri)
Deletes the specified image catalog.
66 67 68 69 70 71 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 66 def delete(catalog_uri) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('delete', catalog_uri) end end |
- (ImageCatalogAttributes) get_attributes(catalog_uri)
Returns attributes of the image catalog specified by the catalog URI.
41 42 43 44 45 46 47 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 41 def get_attributes(catalog_uri) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', catalog_uri) return ImageCatalogAttributes.new(res) end end |
- (UU::OS::REST::ResultList<ImageCatalog::ImageCatalogGetImageList, ImageCatalog::ImageCatalogImageEntryAttributes>) get_image_list(catalog_uri, criteria = nil)
Returns list of images from a catalog. By default, the list is sorted by image names (and codes in case names are equal). The list can be filtered using "query" parameter in criteria using uuQuery 2.0 syntax.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 102 def get_image_list(catalog_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) dto = ImageCatalog::ImageCatalogGetImageList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) if ((dto.query_parameters.kind_of?Hash) && (dto.query_parameters.size > 0)) svc.add_parameter(:queryParameters, dto.query_parameters.to_json) end UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getImageList', catalog_uri) return UU::OS::REST::ResultList.new(ImageCatalog::ImageCatalogGetImageList, ImageCatalog::ImageCatalogImageEntryAttributes, res) end end |
- (Object) import_catalog_data(catalog_uri, catalog_data)
Imports image catalog content data.
77 78 79 80 81 82 83 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 77 def import_catalog_data(catalog_uri, catalog_data) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) payload = ImageCatalogImportCatalogData.new(catalog_data).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('importCatalogData', catalog_uri, payload) end end |
- (UESURI) set_attributes(catalog_uri, attrs)
Sets attributes of the image catalog specified by the catalog URI.
54 55 56 57 58 59 60 61 |
# File 'uu_imagecatalog-0.4.1/lib/uu/image_catalog/image_catalog.rb', line 54 def set_attributes(catalog_uri, attrs) svc = UU::OS::REST::RemoteClient.new(ImageCatalog) payload = ImageCatalogSetAttributes.new(attrs).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', catalog_uri, payload) return UU::OS::UESURI.new(res) end end |