|
| 1 | +# hostinger_api.HostingGitApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**list_git_installation_repositories_v1**](HostingGitApi.md#list_git_installation_repositories_v1) | **GET** /api/hosting/v1/git/installations/{uuid}/repositories | List Git installation repositories |
| 8 | +[**list_git_installations_v1**](HostingGitApi.md#list_git_installations_v1) | **GET** /api/hosting/v1/git/installations | List Git installations |
| 9 | + |
| 10 | + |
| 11 | +# **list_git_installation_repositories_v1** |
| 12 | +> List[HostingV1GitGitRepositoryResource] list_git_installation_repositories_v1(uuid) |
| 13 | +
|
| 14 | +List Git installation repositories |
| 15 | + |
| 16 | +Lists the repositories the Git installation can access, read live from the provider. Works |
| 17 | +for github and gitlab installations. Use an active installation: a suspended or pending one |
| 18 | +is still queried and the call fails with whatever the provider answers. The list is cut at |
| 19 | +the first 500 repositories in the order the provider returns them; when the account has |
| 20 | +more, name the repository directly instead of searching this list. |
| 21 | + |
| 22 | +`owner`, `name` and `default_branch` identify a repository and a branch to deploy. Returns |
| 23 | +404 when the installation does not belong to the customer. Limited to 10 calls per minute |
| 24 | +per API client (429 above that). |
| 25 | + |
| 26 | +### Example |
| 27 | + |
| 28 | +* Bearer Authentication (apiToken): |
| 29 | + |
| 30 | +```python |
| 31 | +import hostinger_api |
| 32 | +from hostinger_api.models.hosting_v1_git_git_repository_resource import HostingV1GitGitRepositoryResource |
| 33 | +from hostinger_api.rest import ApiException |
| 34 | +from pprint import pprint |
| 35 | + |
| 36 | + |
| 37 | +# Configure Bearer authorization: apiToken |
| 38 | +configuration = hostinger_api.Configuration( |
| 39 | + access_token = os.environ["BEARER_TOKEN"] |
| 40 | +) |
| 41 | + |
| 42 | +# Enter a context with an instance of the API client |
| 43 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 44 | + # Create an instance of the API class |
| 45 | + api_instance = hostinger_api.HostingGitApi(api_client) |
| 46 | + uuid = '018f5e2a-1234-7890-abcd-1234567890ab' # str | Git installation UUID from the List Git installations endpoint |
| 47 | + |
| 48 | + try: |
| 49 | + # List Git installation repositories |
| 50 | + api_response = api_instance.list_git_installation_repositories_v1(uuid) |
| 51 | + print("The response of HostingGitApi->list_git_installation_repositories_v1:\n") |
| 52 | + pprint(api_response) |
| 53 | + except Exception as e: |
| 54 | + print("Exception when calling HostingGitApi->list_git_installation_repositories_v1: %s\n" % e) |
| 55 | +``` |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +### Parameters |
| 60 | + |
| 61 | + |
| 62 | +Name | Type | Description | Notes |
| 63 | +------------- | ------------- | ------------- | ------------- |
| 64 | + **uuid** | **str**| Git installation UUID from the List Git installations endpoint | |
| 65 | + |
| 66 | +### Return type |
| 67 | + |
| 68 | +[**List[HostingV1GitGitRepositoryResource]**](HostingV1GitGitRepositoryResource.md) |
| 69 | + |
| 70 | +### Authorization |
| 71 | + |
| 72 | +[apiToken](../README.md#apiToken) |
| 73 | + |
| 74 | +### HTTP request headers |
| 75 | + |
| 76 | + - **Content-Type**: Not defined |
| 77 | + - **Accept**: application/json |
| 78 | + |
| 79 | +### HTTP response details |
| 80 | + |
| 81 | +| Status code | Description | Response headers | |
| 82 | +|-------------|-------------|------------------| |
| 83 | +**200** | Success response | - | |
| 84 | +**404** | Error response | - | |
| 85 | +**429** | Error response | - | |
| 86 | +**401** | Unauthenticated response | - | |
| 87 | +**500** | Error response | - | |
| 88 | + |
| 89 | +[[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) |
| 90 | + |
| 91 | +# **list_git_installations_v1** |
| 92 | +> List[HostingV1GitGitInstallationResource] list_git_installations_v1(provider=provider, status=status) |
| 93 | +
|
| 94 | +List Git installations |
| 95 | + |
| 96 | +Lists the Git provider accounts the customer has connected. Only installations with status |
| 97 | +`active` are returned unless the `status` filter says otherwise. |
| 98 | + |
| 99 | +An empty list means the customer has no active installation. Check `status=suspended` and |
| 100 | +`status=pending` as well. If there is none at all, GitHub has to be connected once in hPanel |
| 101 | +(Websites, Manage, Advanced, Git, Connect GitHub; or Add Website, Node.js Web App, Import Git |
| 102 | +Repository, Continue with GitHub); this endpoint then lists the new installation. |
| 103 | + |
| 104 | +Use `uuid` as the path parameter of `List Git installation repositories`. |
| 105 | + |
| 106 | +### Example |
| 107 | + |
| 108 | +* Bearer Authentication (apiToken): |
| 109 | + |
| 110 | +```python |
| 111 | +import hostinger_api |
| 112 | +from hostinger_api.models.hosting_v1_git_git_installation_resource import HostingV1GitGitInstallationResource |
| 113 | +from hostinger_api.rest import ApiException |
| 114 | +from pprint import pprint |
| 115 | + |
| 116 | + |
| 117 | +# Configure Bearer authorization: apiToken |
| 118 | +configuration = hostinger_api.Configuration( |
| 119 | + access_token = os.environ["BEARER_TOKEN"] |
| 120 | +) |
| 121 | + |
| 122 | +# Enter a context with an instance of the API client |
| 123 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 124 | + # Create an instance of the API class |
| 125 | + api_instance = hostinger_api.HostingGitApi(api_client) |
| 126 | + provider = 'github' # str | Filter by Git provider (optional) |
| 127 | + status = active # str | Filter by installation status (optional) (default to active) |
| 128 | + |
| 129 | + try: |
| 130 | + # List Git installations |
| 131 | + api_response = api_instance.list_git_installations_v1(provider=provider, status=status) |
| 132 | + print("The response of HostingGitApi->list_git_installations_v1:\n") |
| 133 | + pprint(api_response) |
| 134 | + except Exception as e: |
| 135 | + print("Exception when calling HostingGitApi->list_git_installations_v1: %s\n" % e) |
| 136 | +``` |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +### Parameters |
| 141 | + |
| 142 | + |
| 143 | +Name | Type | Description | Notes |
| 144 | +------------- | ------------- | ------------- | ------------- |
| 145 | + **provider** | **str**| Filter by Git provider | [optional] |
| 146 | + **status** | **str**| Filter by installation status | [optional] [default to active] |
| 147 | + |
| 148 | +### Return type |
| 149 | + |
| 150 | +[**List[HostingV1GitGitInstallationResource]**](HostingV1GitGitInstallationResource.md) |
| 151 | + |
| 152 | +### Authorization |
| 153 | + |
| 154 | +[apiToken](../README.md#apiToken) |
| 155 | + |
| 156 | +### HTTP request headers |
| 157 | + |
| 158 | + - **Content-Type**: Not defined |
| 159 | + - **Accept**: application/json |
| 160 | + |
| 161 | +### HTTP response details |
| 162 | + |
| 163 | +| Status code | Description | Response headers | |
| 164 | +|-------------|-------------|------------------| |
| 165 | +**200** | Success response | - | |
| 166 | +**422** | Validation error response | - | |
| 167 | +**401** | Unauthenticated response | - | |
| 168 | +**500** | Error response | - | |
| 169 | + |
| 170 | +[[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) |
| 171 | + |
0 commit comments