5.5

Table Of Contents
3 Create a BundleUploadParams element that specifies the size of the bundle and the service namespace of
the service.
4 POST the BundleUploadParams element to the localizationbundles URL of your service.
Example: Upload a Localization Bundle
This example uploads a localization bundle for the service created in “Example: Register an Extension
Service,” on page 333. The initial request specifies the size of the ZIP file in bytes and the name of the service
namespace.
Request:
POST https://vcloud.example.com/api/admin/extension/service/45/localizationbundles
Content-type: application/vnd.vmware.admin.bundleUploadParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<vmext:BundleUploadParams
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
fileSize="537"
serviceNamespace="org.example.vcd.backup">
</vmext:BundleUploadParams>
The response body includes an uploadLocation URL. You can use a procedure similar to the one in
“Example: Uploading File Data,” on page 66 to upload the ZIP file to this location.
Response:
<vmext:BundleUploadSocket
uploadLocation="https://vcloud.example.com/transfer/6f3b.../file"
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5">
</vmext:BundleUploadSocket>
To update a bundle, follow the same procedure using a new bundle that contains updated message files.
When you upload a new localization bundle for a service that already has one, new key=value pairs are
added, and the values of existing keys are updated.
Message File Content
Message files provide localized text for certain attribute values in Task and Event objects.
Each file in a localization bundle can include an arbitrary number of lines. Each line must have the following
form, where key is any of the values that the service might assign to one of its service-specific Task or Event
elements and value is the localized string to display.
key=value
The value string can contain parameters that provide the resourceId, resourceName, and resourceType of the
subject of the Task or Event.
The following restrictions apply to each message file in a localization bundle:
n
File contents must be encoded in the UTF-8 character set.
n
key length cannot exceed 2000 UTF-8 characters.
n
value length cannot exceed 2000 UTF-8 characters.
n
File size cannot exceed 10MB.
n
File name must be the locale code for the language used in the value strings. For example, the file
containing English text must be named en_US. The file containing French text must be named fr_FR.
Chapter 11 vCloud Director Extension Services
VMware, Inc. 351