Private Catalog enables developers and cloud admins to make their solutions discoverable to their own organization's internal enterprise users.

While making solutions discoverable, cloud admins can also control the distribution of solutions and ensure compliance and governance.

Private Catalog includes two APIs, the Private Catalog Producer API and the Private Catalog API. The Private Catalog Producer API allows cloud admins to build and manage catalogs. The Private Catalog API allows users to discover catalogs and the products contained in them.

A cloud admin can use the Private Catalog Producer API to create a catalog under an organization. The catalog contains a cloud admin-curated list of trustworthy products. Cloud admins can then use the same API to share the catalog to the whole organization. All other users in the same organization can see the shared catalog and its products if they have permission.

Private Catalog can list solutions for internal enterprise users to discover and deploy. After cloud admins create a catalog, cloud admins can curate and update the content and define governance.

What you'll learn

What you need

  1. Select or create a GCP project.

GO TO THE MANAGE RESOURCES PAGE

  1. Make sure that billing is enabled for your project.

LEARN HOW TO ENABLE BILLING

  1. Enable the Deployment Manager and Compute Engine APIs.

ENABLE THE APIS

As a cloud admin, you can make REST calls to perform actions on Private Catalog. To get started, set up your access credentials:

  1. Get your client ID and secret.
  2. Get your access token.
  3. Make sure to send https://www.googleapis.com/auth/cloud-platform in the scope parameter.

To create a catalog, run the following command and replace <token> with your OAuth2 access token and <organization-ID> with your organization ID:

curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d "{parent:"//cloudresourcemanager.googleapis.com/organizations/<organization-ID>", display_name:"Mobile catalog", description: "description"}" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs

The response body contains data similar to the following output:

{
  "name": "operations/ccb.515502c5-81ad-4226-8037-1b802eed8f69"
}

This is the operation name. You can derive the operation ID from the operation name by removing the prefix operation/. In the previous example response, the operation ID is ccb.515502c5-81ad-4226-8037-1b802eed8f69. You can use the operation ID to check the status of the creation of the catalog.

To create a catalog, run the following command and replace <operation-ID> with the operation ID from the previous response:

curl -s -H "Authorization: Bearer <token>" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/operations/<operation-ID>

To list catalogs that you have access to, within the scope of an organization, run the following command and replace <organization-number> with the organization number:

curl -s -H "Authorization: Bearer <token>" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs?parent=//cloudresourcemanager.googleapis.com/organizations/<organization-number>

The response body contains data similar to the following output:

{
  "catalogs": [
    {
      "name": "catalogs/<catalog-ID>",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/<organization-ID>",
      "displayName": "Mobile catalog",
      "description": "Mobile-related applications",
      "createTime": "2019-01-01T22:05:19.541Z",
      "updateTime": "2019-01-01T22:05:26.097Z"
    },
    {
      "name": "catalogs/<catalog ID>",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/<organization-ID>",
      "displayName": "Development tools",
      "description": "Applications and tools for developers",
      "createTime": "2019-01-06T00:08:06.090Z",
      "updateTime": "2019-01-06T00:08:08.069Z"
    },
    {
      "name": "catalogs/<catalog ID>",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/<organization-ID>",
      "displayName": "Data science catalog",
      "description": "Applications for data scientists",
      "createTime": "2019-01-06T00:09:45.319Z",
      "updateTime": "2019-01-06T00:09:48.050Z"
    },
    {
      "name": "catalogs/<catalog ID>",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/<organization-ID>",
      "displayName": "Training catalog",
      "description": "Training applications and software",
      "createTime": "2019-01-06T22:13:38.261Z",
      "updateTime": "2019-01-06T22:13:46.291Z"
    },
    {
      "name": "catalogs/<catalog-ID>",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/<organization-ID>",
      "displayName": "Media catalog",
      "description": "Applications for handling audio and visual media",
      "createTime": "2019-01-07T00:15:11.949Z",
      "updateTime": "2019-01-07T00:15:15.426Z"
    }
  ]
}

To get information about a catalog, run the following command and replace <catalog-ID> with the catalog ID from the response of an API call to list your organization's catalogs:

curl -s -H "Authorization: Bearer <token>" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-ID>

The response body contains data similar to the following output:

{
  "name": "catalogs/<catalog-ID>",
  "parent": "//cloudresourcemanager.googleapis.com/organizations/<organizaton-ID>",
  "displayName": "Data science catalog",
  "description": "Applications for data scientists",
  "createTime": "2019-01-01T22:05:19.541Z",
  "updateTime": "2019-01-01T22:05:26.097Z"
}

To create a product, run the following command and replace <catalog-ID> with the catalog ID from the response of an API call to list your organization's catalogs:

curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d @/tmp/rest_create_product_request https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-ID>/products

The following example illustrates the contents of the /tmp/rest_create_product_request file:

{
  name:"catalogs/<catalog-ID>/products/<product-name>",
  asset_type:"google.deploymentmanager.Template",
  display_metadata:{
    name:"<product-name>",
    description:"Sample Description"
  }
}

To list products in a catalog, run the following command and replace <catalog-ID> with the catalog ID from the response of an API call to list your organization's catalogs:

curl -s -H "Authorization: Bearer <token>" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-ID>/products

The response body contains data similar to the following output:

{
  "products": [
    {
      "name": "catalogs/<catalog-ID>/products/dm-product",
      "assetType": "google.deploymentmanager.Template",
      "displayMetadata": {
        "name": "sample-metadata-name",
        "description": "sample-metadata-description",
        "tagline": "sample-metadata-tagline",
        "support_info": "sample-metadata-support-info"
      },
      "createTime": "2019-01-04T19:36:02.573Z"
    },
    {
      "name": "catalogs/<catalog-ID>/products/listingonly",
      "assetType": "google.private-catalog.ListingOnly",
      "displayMetadata": {
        "name": "listing-based product",
        "description": "description",
        "tagline": "tagline",
        "support_info": "support_info",
        "signup_url": "https://cloud.google.com/launcher",
        "documentations": [
          {
            "url": "https://cloud.google.com/launcher"
          }
        ]
      },
      "createTime": "2019-01-06T00:25:44.722Z"
    }
  ]
}

To create a product version, run the following command and replace <catalog-ID> with a catalog ID and <product-name> with the name of the product you want to create a version for:

curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d @/tmp/rest_create_version_request https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-ID>/products/<product-name>/versions

The following example illustrates the contents of the /tmp/rest_create_version_request file:

{
  name: "catalogs/<catalog-ID>/products/<product-name>/versions/v1",
  description: "v1",
  original_asset: {
        imports: [
                {
                  name: "my-template",
                  content: "resources:\n name: \'awesome template\'\n  properties:\n",
                },
                {
                  name: "my-template.schema",
                  content: ""
                }
        ],
        mainTemplate: "my-template",
        templateFileType: "JINJA"
  }
}

The response body contains data about the resulting operation, similar to the following output:

{ "name": "operations/cvb.efcd831d-257d-43f7-8650-f7016c7469cb" }

To list the versions of a product, run the following command and replace <catalog-ID> with the catalog ID and <product-name> with the name of the product you want to list versions for:

curl -s -H "Authorization: Bearer <token>" https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-ID>/products/<product-name>/versions

The response body contains data similar to the following output:

{
  "versions": [
    {
      "name": "catalogs/<catalog-ID>/products/<product-name>/versions/v1",
      "createTime": "2019-01-04T19:37:47.519Z",
      "updateTime": "2019-01-04T19:37:47.519Z"
    }
  ]
}

To upload a product icon, run the following command and replace <catalog-ID> with the catalog ID and <product-name> with the name of the product you want to upload an icon for:

curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d @/tmp/rest_upload_icon_request https://cloudprivatecatalogproducer.googleapis.com/v1beta1/catalogs/<catalog-id>/products/<product-name>/icons:upload

The following example illustrates the contents of the /tmp/rest_upload_icon_request file:

{
  icon_bytes: "iVBORw0KGgoA...Jggg=="
}

You've successfully learned how to use Private Catalog.

In this usage guide, you learned:

To learn more about Private Catalog, see the developer documentation.