|
| 1 | +# HostingGitApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +|Method | HTTP request | Description| |
| 6 | +|------------- | ------------- | -------------| |
| 7 | +|[**listGitInstallationRepositoriesV1**](#listgitinstallationrepositoriesv1) | **GET** /api/hosting/v1/git/installations/{uuid}/repositories | List Git installation repositories| |
| 8 | +|[**listGitInstallationsV1**](#listgitinstallationsv1) | **GET** /api/hosting/v1/git/installations | List Git installations| |
| 9 | + |
| 10 | +# **listGitInstallationRepositoriesV1** |
| 11 | +> Array<HostingV1GitGitRepositoryResource> listGitInstallationRepositoriesV1() |
| 12 | +
|
| 13 | +Lists the repositories the Git installation can access, read live from the provider. Works for github and gitlab installations. Use an active installation: a suspended or pending one is still queried and the call fails with whatever the provider answers. The list is cut at the first 500 repositories in the order the provider returns them; when the account has more, name the repository directly instead of searching this list. `owner`, `name` and `default_branch` identify a repository and a branch to deploy. Returns 404 when the installation does not belong to the customer. Limited to 10 calls per minute per API client (429 above that). |
| 14 | + |
| 15 | +### Example |
| 16 | + |
| 17 | +```typescript |
| 18 | +import { |
| 19 | + HostingGitApi, |
| 20 | + Configuration |
| 21 | +} from '@hostinger/sdk'; |
| 22 | + |
| 23 | +const configuration = new Configuration(); |
| 24 | +const apiInstance = new HostingGitApi(configuration); |
| 25 | + |
| 26 | +let uuid: string; //Git installation UUID from the List Git installations endpoint (default to undefined) |
| 27 | + |
| 28 | +const { status, data } = await apiInstance.listGitInstallationRepositoriesV1( |
| 29 | + uuid |
| 30 | +); |
| 31 | +``` |
| 32 | + |
| 33 | +### Parameters |
| 34 | + |
| 35 | +|Name | Type | Description | Notes| |
| 36 | +|------------- | ------------- | ------------- | -------------| |
| 37 | +| **uuid** | [**string**] | Git installation UUID from the List Git installations endpoint | defaults to undefined| |
| 38 | + |
| 39 | + |
| 40 | +### Return type |
| 41 | + |
| 42 | +**Array<HostingV1GitGitRepositoryResource>** |
| 43 | + |
| 44 | +### Authorization |
| 45 | + |
| 46 | +[apiToken](../README.md#apiToken) |
| 47 | + |
| 48 | +### HTTP request headers |
| 49 | + |
| 50 | + - **Content-Type**: Not defined |
| 51 | + - **Accept**: application/json |
| 52 | + |
| 53 | + |
| 54 | +### HTTP response details |
| 55 | +| Status code | Description | Response headers | |
| 56 | +|-------------|-------------|------------------| |
| 57 | +|**200** | Success response | - | |
| 58 | +|**404** | Error response | - | |
| 59 | +|**429** | Error response | - | |
| 60 | +|**401** | Unauthenticated response | - | |
| 61 | +|**500** | Error response | - | |
| 62 | + |
| 63 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 64 | + |
| 65 | +# **listGitInstallationsV1** |
| 66 | +> Array<HostingV1GitGitInstallationResource> listGitInstallationsV1() |
| 67 | +
|
| 68 | +Lists the Git provider accounts the customer has connected. Only installations with status `active` are returned unless the `status` filter says otherwise. An empty list means the customer has no active installation. Check `status=suspended` and `status=pending` as well. If there is none at all, GitHub has to be connected once in hPanel (Websites, Manage, Advanced, Git, Connect GitHub; or Add Website, Node.js Web App, Import Git Repository, Continue with GitHub); this endpoint then lists the new installation. Use `uuid` as the path parameter of `List Git installation repositories`. |
| 69 | + |
| 70 | +### Example |
| 71 | + |
| 72 | +```typescript |
| 73 | +import { |
| 74 | + HostingGitApi, |
| 75 | + Configuration |
| 76 | +} from '@hostinger/sdk'; |
| 77 | + |
| 78 | +const configuration = new Configuration(); |
| 79 | +const apiInstance = new HostingGitApi(configuration); |
| 80 | + |
| 81 | +let provider: 'github' | 'gitlab' | 'bitbucket'; //Filter by Git provider (optional) (default to undefined) |
| 82 | +let status: 'pending' | 'active' | 'suspended'; //Filter by installation status (optional) (default to 'active') |
| 83 | + |
| 84 | +const { status, data } = await apiInstance.listGitInstallationsV1( |
| 85 | + provider, |
| 86 | + status |
| 87 | +); |
| 88 | +``` |
| 89 | + |
| 90 | +### Parameters |
| 91 | + |
| 92 | +|Name | Type | Description | Notes| |
| 93 | +|------------- | ------------- | ------------- | -------------| |
| 94 | +| **provider** | [**'github' | 'gitlab' | 'bitbucket'**]**Array<'github' | 'gitlab' | 'bitbucket'>** | Filter by Git provider | (optional) defaults to undefined| |
| 95 | +| **status** | [**'pending' | 'active' | 'suspended'**]**Array<'pending' | 'active' | 'suspended'>** | Filter by installation status | (optional) defaults to 'active'| |
| 96 | + |
| 97 | + |
| 98 | +### Return type |
| 99 | + |
| 100 | +**Array<HostingV1GitGitInstallationResource>** |
| 101 | + |
| 102 | +### Authorization |
| 103 | + |
| 104 | +[apiToken](../README.md#apiToken) |
| 105 | + |
| 106 | +### HTTP request headers |
| 107 | + |
| 108 | + - **Content-Type**: Not defined |
| 109 | + - **Accept**: application/json |
| 110 | + |
| 111 | + |
| 112 | +### HTTP response details |
| 113 | +| Status code | Description | Response headers | |
| 114 | +|-------------|-------------|------------------| |
| 115 | +|**200** | Success response | - | |
| 116 | +|**422** | Validation error response | - | |
| 117 | +|**401** | Unauthenticated response | - | |
| 118 | +|**500** | Error response | - | |
| 119 | + |
| 120 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 121 | + |
0 commit comments