|
1 | 1 | # Developing Against the SDK API (Beta) |
2 | 2 |
|
3 | | -This topic describes how to enable integration mode for the Replicated SDK to develop and test changes locally. For more information about the SDK API, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis). |
| 3 | +This topic describes how to use integration mode for the Replicated SDK to develop and test changes locally. For more information about the SDK API, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis). |
4 | 4 |
|
5 | | -## About Integration Mode |
| 5 | +## Overview |
6 | 6 |
|
7 | 7 | You can use the Replicated SDK in integration mode to develop locally against the SDK API without needing to make real changes in the Replicated Vendor Portal or in your environment. |
8 | 8 |
|
9 | | -To use integration mode, install the Replicated SDK as a standalone component using a valid development license created in the Replicated Vendor Portal. After you install in integration mode, the SDK provides default mock data for requests to the SDK API `app` endpoints. Requests to the `license` endpoints use the real data from your development license. |
| 9 | +To use integration mode, install the Replicated SDK as a standalone component using a valid development license created in the Vendor Portal. After you install in integration mode, the SDK provides default mock data for requests to the SDK API `app` endpoints. Requests to the `license` endpoints use the real data from your development license. |
10 | 10 |
|
11 | | -To use the Replicated SDK in integration mode, complete the following procedures: |
12 | | -1. [Create a Development License](#license) |
13 | | -1. [Install the SDK in integration mode](#install) |
| 11 | +To develop against the SDK API: |
14 | 12 |
|
15 | | -## Create a Development License {#license} |
| 13 | +1. Create a Development license that you can use to install the SDK in integration mode: |
16 | 14 |
|
17 | | -To use integration mode, you first need to create a development license that you can use to install the SDK. When you create the development license, you can add values to any license fields that you want to use in testing. |
| 15 | + 1. In the Vendor Portal, go to **Customers** and click **Create customer**. |
18 | 16 |
|
19 | | -For information about development licenses, see [License Types](licenses-about#license-types) in _About Licenses_. |
| 17 | + 1. Complete the following fields: |
| 18 | + |
| 19 | + 1. For **Customer name**, add a name for the customer. |
| 20 | + |
| 21 | + 1. For **Assigned channel**, assign the customer to the channel that you use for testing. For example, Unstable. |
| 22 | + |
| 23 | + 1. For **Customer type**, select **Development**. |
| 24 | + |
| 25 | + 1. For **Customer email**, add the email address that you want to use for the license. |
20 | 26 |
|
21 | | -To create a development license: |
| 27 | + 1. For **Install types**, ensure that the **Existing Cluster (Helm CLI)** option is enabled. |
22 | 28 |
|
23 | | -1. In the Vendor Portal, go to **Customers** and click **Create customer**. |
| 29 | + 1. (Optional) Add any license field values that you want to use for testing: |
24 | 30 |
|
25 | | -1. Complete the following fields: |
26 | | - |
27 | | - 1. For **Customer name**, add a name for the customer. |
28 | | - |
29 | | - 1. For **Assigned channel**, assign the customer to the channel that you use for testing. For example, Unstable. |
30 | | - |
31 | | - 1. For **Customer type**, select **Development**. |
32 | | - |
33 | | - 1. For **Customer email**, add the email address that you want to use for the license. |
| 31 | + 1. For **Expiration policy**, you can add an expiration date for the license. |
34 | 32 |
|
35 | | -  |
36 | | - [View a larger version of this image](/images/create-customer-development-mode.png) |
| 33 | + 1. For **Custom fields**, you can add values for any custom license fields in your application. For information about how to create custom license fields, see [Managing Customer License Fields](/vendor/licenses-adding-custom-fields). |
37 | 34 |
|
38 | | -1. (Optional) Add any license field values that you want to use for testing: |
| 35 | + 1. Click **Save Changes**. |
39 | 36 |
|
40 | | - 1. For **Expiration policy**, you can add an expiration date for the license. |
| 37 | +1. On the **Manage customer** page for the customer you created, click **Helm install instructions**. |
41 | 38 |
|
42 | | - 1. For **Custom fields**, you can add values for any custom license fields in your application. For information about how to create custom license fields, see [Managing Customer License Fields](/vendor/licenses-adding-custom-fields). |
| 39 | + <img alt="Helm install instructions button on the manage customer page" src="/images/helm-install-instructions-button.png" width="700px"/> |
43 | 40 |
|
44 | | -1. Click **Save Changes**. |
| 41 | + [View a larger version of this image](/images/helm-install-instructions-button.png) |
45 | 42 |
|
46 | | -## Install the SDK in Integration Mode {#install} |
| 43 | +1. In the **Helm install instructions** dialog, copy and run the command to log in to the Replicated registry. |
47 | 44 |
|
48 | | -To develop against the SDK locally in your development environment, install the SDK in integration mode as a standalone component in your cluster. |
| 45 | + <img alt="Registry login command in the Helm install instructions dialog" src="/images/helm-install-instructions-registry-login.png" width="600px"/> |
49 | 46 |
|
50 | | -To install the SDK in integration mode: |
| 47 | + [View a larger version of this image](/images/helm-install-instructions-registry-login.png) |
51 | 48 |
|
52 | | -1. On the **Manage customer** page for the customer you created, click **Helm install instructions**. |
| 49 | +1. From the same dialog, copy and run the command to install the SDK in integration mode: |
53 | 50 |
|
54 | | -  |
| 51 | + <img alt="SDK integration mode install command in the Helm install instructions dialog" src="/images/helm-install-instructions-sdk-integration.png" width="600px"/> |
55 | 52 |
|
56 | | -1. In the **Helm install instructions** dialog, copy and run the command to log in to the Replicated registry. |
| 53 | + [View a larger version of this image](/images/helm-install-instructions-sdk-integration.png) |
57 | 54 |
|
58 | | -  |
| 55 | + After the Replicated SDK is installed and initialized in a cluster, the Replicated SDK API is exposed at `replicated:3000`. You can access the SDK API for testing by forwarding port 3000 to your local machine. |
59 | 56 |
|
60 | | -1. From the same dialog, copy and run the command to install the SDK in integration mode: |
| 57 | +1. Run the following command to port forward to the SDK API service: |
| 58 | + |
| 59 | + ```bash |
| 60 | + kubectl port-forward service/replicated 3000 |
| 61 | + ``` |
| 62 | + ``` |
| 63 | + Forwarding from 127.0.0.1:3000 -> 3000 |
| 64 | + Forwarding from [::1]:3000 -> 3000 |
| 65 | + ``` |
| 66 | + |
| 67 | +1. With the port forward running, test the SDK API endpoints as desired. For example: |
61 | 68 |
|
62 | | -  |
| 69 | + ```bash |
| 70 | + curl localhost:3000/api/v1/license/fields/expires_at |
| 71 | + curl localhost:3000/api/v1/license/fields/{field} |
| 72 | + ``` |
| 73 | + |
| 74 | + For more information about using the SDK API, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis). |
63 | 75 |
|
64 | | -1. Make requests to the SDK API from your application. Requests to the `license` endpoints use your actual development license data, while requests to the `app` endpoints use the default mock data. For more information about using the SDK API, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis). |
| 76 | + :::note |
| 77 | + Requests to the `license` endpoints use your actual development license data, while requests to the `app` endpoints use the default mock data. |
| 78 | + ::: |
0 commit comments