VMware vCloud Suite SDK Java: provider README |
|
README for provider SDK sample
vCloud Suite SDK Java README
The VMware vCloud Suite SDK for Java contains a provider development kit for defining, implementing and exposing new API services (API Extensibility). The provider development kit contains tools for generating client (stub) and server (skeleton) code, generating json metadata files etc. The following section describes the current directory contents:
Directory structure
Directory | Contents | Documentation |
toolkits |
Toolkits required for generating java stub/skeleton code, json metadata files. |
Java, Metadata toolkit and libraries |
lib |
Provider SDK's dependent libraries |
libraries required for running a provider |
sample |
Provider SDK sample |
README for backup-provider SDK sample
|
Provider SDK sample
The samples sub-directories are organized into the following capabilities:
Directory | Description |
java/com/acme/virtualmachine | Contains generated client/server(stub/skeleton) code using the java-toolkit |
java/com/acme/virtualmachine/backup/client | Contains sample client code for consuming the backup provider via the vapi endpoint |
java/com/acme/virtualmachine/backup/health | Contains code which reports the providers health |
java/com/acme/virtualmachine/backup/server | Contains code starting provider and registering provider with Lookup Service |
java/com/acme/virtualmachine/backup/common | Contains code for reading the properties(backup.properties) |
java/com/acme/virtualmachine/impl | Contains code for the provider implementation(generated skeleton code implementation) |
resources | Contains sample provider's property file and the provider's spring configuration file. The spring config file is during the provider startup for loading the provider implementation |
resources/metadata | Contains sample provider's generated metadata json files using the metadata-toolkit. Starting local provider using BackupServer.java loads the backup provider implementation interface and also loads the json files |
resources/vmodl | Contains sample provider's authentication and authorization information in the .ini files |
resources/vmodl/com/acme/virtualmachine | Contains sample provider's API definition |
Please refer to
Running the backup-provider sample for details.
Provider SDK toolkits
toolkits directory contains the Java, Metadata toolkits and its required libraries for code generation.
- java toolkit (toolkits/bin/java-generator) creates the stub/skeleton code for the API definition (new functionality).
The stub code acts as the client code/library which can be used to interact with the skeleton code/server side implementation of your new functionality.
Ex:The below generated code contains a Backup.java(client interface) and BackupProvider(service/API interface)
D:\VMware-vCloudSuite-Java-SDK\provider>toolkits\bin\java-generator.bat --library toolkits\vmidl\vapi_stdlib.vmidl --output samples\backup-provider samples\backup-provider\resources\vmodl
INFO: Generating java files ...
INFO: Processing target language: java
INFO: > Found 1 java language 'products' templates ...
INFO: > Found 2 java language 'packages' templates ...
INFO: > Found 8 java language 'services' templates ...
INFO: > Found 1 java language 'structures' templates ...
INFO: > Found 1 java language 'enumerations' templates ...
INFO: Processing product scope templates ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\util\StructTypeUtil.java ...
INFO: Processing package scope templates for 'idl.model.IdlPackage(name:com.acme.virtualmachine)' ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\StructDefinitions.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\package-info.java ...
INFO: Processing service scope templates for 'Backup' ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\Backup.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupApiInterface.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupDefinitions.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupProvider.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupStub.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupSyncApiInterface.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupSyncProvider.java ...
INFO: > Generating file: samples\backup-provider\java\com\acme\virtualmachine\BackupTypes.java ...
- metadata toolkit (toolkits/bin/metadata-generator) creates the necessary metadata json files from the API definition (new functionality) and your *.ini files(authentication & authorization for the new functionality).
Ex:The below generated json files provider dynamic metadata information about the backup provider. Information like authentication, authorization, cli, model information of the backup provider
D:\VMware-vCloudSuite-Java-SDK\provider>toolkits\bin\metadata-generator.bat --metadata samples\backup-provider\resources\vmodl\authn.ini --metadata samples\backup-provider\resources\vmodl\authz.ini --library toolkits\vmidl\vapi_stdlib.vmidl --product-name backup --output samples\backup-provider\resources samples\backup-provider\resources\vmodl
INFO: Generating metadata files ...
INFO: Processing target language: metadata
INFO: > Found 8 metadata language 'products' templates ...
INFO: Processing product scope templates ...
INFO: > Generating file: samples\backup-provider\resources\metadata\backup_authentication.json ...
INFO: > Generating file: samples\backup-provider\resources\metadata\backup_authorization.json ...
INFO: > Generating file: samples\backup-provider\resources\metadata\backup_cli.json ...
INFO: > Generating file: samples\backup-provider\resources\metadata\backup_metamodel.json ...
Provider SDK libraries
lib directory contains java libraries java libraries required for running the backup provider.
Copyright © 2015 VMware, Inc. All rights not expressly granted herein are reserved.
|
Last updated: 26th Jan 2015 | VMware vCloud Suite SDK Java |
|