You can publish a local library at the time of creation to enable other libraries to subscribe and use the library content.

Procedure

  1. Retrieve the LocalLibrary service.
  2. Create a PublishInfo instance to define how the library is published.
  3. Specify the authentication method to be used by a subscribed library to authenticate to the local library.
    You can enable either basic authentication or no authentication on the library. Basic authentication requires a user name and password.
  4. (Optional) If you publish the library with basic authentication, you must specify a user name and password for the PublishInfo instance, which must be used for authentication.
    Important: Use the predefined user name vcsp or leave the user name undefined. You must set only a password to protect the library.
  5. (Optional) Create a SecurityPolicies instance to define the security policy rules for the library. For vSphere 7.0 Update3, you can only define rules for an OVF and OVA templates in the library by using the OVF_STRICT_VERIFICATION security rule. When the OVF security policy is configured for a local content library, an OVF or OVA template can be synchronized or imported to the library only after its certificate is validated against a trusted certificate authority.
  6. Create a LibraryModel instance and configure the instance.
    If you want to apply a security policy on the local library, you must use the setSecurityPolicyId(java.lang.String securityPolicyId) method or the security_policy_id parameter of the LibraryModel instance.
  7. Set the library type to local and use the configured PublishInfo instance to set the library to published.
  8. Define where the content of the local library is stored by using the StorageBacking class.
  9. Create a published local library.