Deployment Manager offers the ability to register a third-party API with the Deployment Manager service. After registering an API as a type provider with Deployment Manager, you can use Deployment Manager to deploy resources from the API as types in your configuration.
This document is a one-page guide that describes the process of integrating a third-party API with Deployment Manager. This page does not contain comprehensive instructions for each step of the process but provides an overview and additional links for more information. Use this page to gain a high-level view of the process for adding an API but refer to the detailed documentation for step-by-step instructions.
Determining if an API is eligible for integrating with Deployment Manager
Deployment Manager has certain expectations of any API that attempts to integrate with it. Specifically:
- Deployment Manager expects a RESTful API. That is, the API exposes a REST-like interface with Create, Read, Update, and Delete (CRUD) methods.
- All path and query parameters resolve successfully. All path and query parameters of the API must exist as part of the resource body or exist on all methods of the API, so that Deployment Manager can match the parameter when a user supplies it.
- The API's descriptor document endpoint must be accessible. Deployment Manager makes an HTTP request to get an API's descriptor document so the document must be hosted somewhere accessible by Deployment Manager. The document must be publicly available or protected by basic authentication.
- Related to the previous point, the API has either basic authentication, or, if the API is running on Google Kubernetes Engine or Google Cloud Endpoints, the API supports OAuth 2.0 authentication using an access token from the project's service account. Read more about authentication.
- If your API is complex, you might need to configure additional options to explain to Deployment Manager how to handle less obvious API behavior.
For more information, read the API Requirements documentation.
Adding your API to Deployment Manager
After determining that your API matches the requirements above, add the API as a Type Provider resource. You must provide an API descriptor document and optionally, any additional API options using advanced options. Adding an API as a type provider exposes all resources of that API to Deployment Manager and allows users to create, update, or delete those resources with Deployment Manager.
If your API has subtle API patterns that might not be easily recognizable, you will need to also provide input mappings to Deployment Manager so it can properly handle API requests. For information, read Advanced API Options.
Calling a type provider in configuration files
Once an API is registered with Deployment Manager, you can create API resources by calling that API resource as a type in your configuration.
For example, if you named your type provider
example-directory-api and you
want to create an API resource known as
person, you can specify the type
in your configurations like so:
resources: - name: Jane type: my-project/example-directory-api:person properties: - name: Jane website: www.example.com ...
To compare, this is the same process as calling a Google API and creating an API resource:
resource: - name: example-instance type: compute.v1.instance properties: - machineType: n1-standard-1 ...
- Read about the API requirements for adding an API to Deployment Manager
- Follow the instructions to add an API.
- Learn more about advanced API options.
- Learn more about types.
- Read about creating a configuration.
- Create a deployment.