Every organization has an add URL for catalogs. An administrator or catalog author can create a catalog by POSTing an AdminCatalog element to this URL
A new Catalog object is an empty container for catalog items, which are references to vApp templates and media images. There are several options for creating a catalog:
- You can create a catalog to use in your own organization or cloud, to hold content that you create locally by uploading, importing, or capturing.
- If the system administrator has given your organization permission to publish externally, you can create a catalog that is published externally or enable external publication of a catalog that you create locally. See Create a Catalog For External Publication and Publish an Existing Catalog Externally.
- If the system administrator has given your organization permission to subscribe to an external catalog, you can create a catalog that downloads its contents from an external source.
Note:
You cannot use catalogs created from an external subscription to hold catalog items that you create locally. Catalogs that contain catalog items created locally cannot have an external subscription. See Create a Catalog With an External Subscription.
Prerequisites
-
This operation requires the rights included in the predefined Catalog Author role or an equivalent set of rights.
-
Verify that at least one VDC exists in your organization. You cannot create a catalog in an organization that has no VDCs.
Procedure
Results
The server creates an empty catalog and returns its representation in the response. See the response portion of Create a Catalog.
Example: Create a Catalog
This example adds a catalog to the organization created in Create an Organization. Because the request does not specify a CatalogStorageProfile, the catalog is created on the default storage profile for the first VDC created in the organization. To create the catalog on a specific storage profile, you can add a CatalogStorageProfiles element to the request. See Specify a Storage Profile for a Catalog.
POST https://vcloud.example.com/api/admin/org/26/catalogs Content-Type: application/vnd.vmware.admin.catalog+xml ... <?xml version="1.0" encoding="UTF-8"?> <AdminCatalog xmlns="http://www.vmware.com/vcloud/v1.5" name="Example Catalog"> <Description>New Catalog for Example Org</Description> </AdminCatalog>
The response contains information extracted from the request, and includes these additions that the server creates:
- A URL, in the value of the href attribute of the response body, that references the new catalog.
- Links that implement operations on the catalog.
- A link to an alternate view of this catalog. All users can access the catalog at this URL.
- An empty CatalogItems element.
- A Task that tracks the creation of the catalog.
- An IsPublished element whose content is the string
false
, indicating that the catalog is not shared with other organizations. See Share a Catalog with All Organizations in a Cloud. - A VersionNumber element with an initial value of
1
. See Version Numbers.
201 Created Content-Type: application/vnd.vmware.admin.catalog+xml ... <AdminCatalog xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" name="Example Catalog" id="urn:vcloud:catalog:32" type="application/vnd.vmware.admin.catalog+xml" href="https://vcloud.example.com/api/admin/catalog/32"> <Link rel="up" type="application/vnd.vmware.admin.organization+xml" href="https://vcloud.example.com/api/admin/org/26" /> <Link rel="alternate" type="application/vnd.vmware.vcloud.catalog+xml" href="https://vcloud.example.com/api/catalog/32" /> <Link rel="down" type="application/vnd.vmware.vcloud.owner+xml" href="https://vcloud.example.com/api/admin/catalog/32/owner" /> <Link rel="edit" type="application/vnd.vmware.admin.catalog+xml" href="https://vcloud.example.com/api/admin/catalog/32" /> <Link rel="remove" href="https://vcloud.example.com/api/admin/catalog/32" /> <Link ... > ... <Tasks> <Task status="running" ... operation="Creating Catalog Example Catalog (32)" ...> ... <Task> <Tasks> <Description>New Catalog for Example Org</Description> <CatalogItems/> <IsPublished>false</IsPublished> <DateCreated>2013-06-18T09:52:59.260-07:00</DateCreated> <VersionNumber>1</VersionNumber> <CatalogStorageProfiles/> </AdminCatalog>