|
| 1 | +# hostinger_api.GPUExposedServicesApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**create_exposed_service_v1**](GPUExposedServicesApi.md#create_exposed_service_v1) | **POST** /api/gpu/v1/instances/{instanceId}/exposed-services | Create exposed service |
| 8 | +[**delete_exposed_service_v1**](GPUExposedServicesApi.md#delete_exposed_service_v1) | **DELETE** /api/gpu/v1/instances/{instanceId}/exposed-services/{exposedServiceId} | Delete exposed service |
| 9 | +[**get_exposed_services_v1**](GPUExposedServicesApi.md#get_exposed_services_v1) | **GET** /api/gpu/v1/instances/{instanceId}/exposed-services | Get exposed services |
| 10 | + |
| 11 | + |
| 12 | +# **create_exposed_service_v1** |
| 13 | +> CommonSuccessEmptyResource create_exposed_service_v1(instance_id, gpuv1_exposed_service_store_request) |
| 14 | +
|
| 15 | +Create exposed service |
| 16 | + |
| 17 | +Expose a service running on a specified GPU instance to the internet. |
| 18 | + |
| 19 | +The service is exposed asynchronously: a successful request returns immediately, and the service |
| 20 | +appears in the exposed services list once it gets its public hostname and external port. |
| 21 | +Fails when the instance already has the maximum of 4 exposed services. |
| 22 | + |
| 23 | +Use this endpoint to make an application on your GPU instance publicly reachable. |
| 24 | + |
| 25 | +### Example |
| 26 | + |
| 27 | +* Bearer Authentication (apiToken): |
| 28 | + |
| 29 | +```python |
| 30 | +import hostinger_api |
| 31 | +from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource |
| 32 | +from hostinger_api.models.gpuv1_exposed_service_store_request import GPUV1ExposedServiceStoreRequest |
| 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.GPUExposedServicesApi(api_client) |
| 46 | + instance_id = 6325 # int | GPU instance ID |
| 47 | + gpuv1_exposed_service_store_request = hostinger_api.GPUV1ExposedServiceStoreRequest() # GPUV1ExposedServiceStoreRequest | |
| 48 | + |
| 49 | + try: |
| 50 | + # Create exposed service |
| 51 | + api_response = api_instance.create_exposed_service_v1(instance_id, gpuv1_exposed_service_store_request) |
| 52 | + print("The response of GPUExposedServicesApi->create_exposed_service_v1:\n") |
| 53 | + pprint(api_response) |
| 54 | + except Exception as e: |
| 55 | + print("Exception when calling GPUExposedServicesApi->create_exposed_service_v1: %s\n" % e) |
| 56 | +``` |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +### Parameters |
| 61 | + |
| 62 | + |
| 63 | +Name | Type | Description | Notes |
| 64 | +------------- | ------------- | ------------- | ------------- |
| 65 | + **instance_id** | **int**| GPU instance ID | |
| 66 | + **gpuv1_exposed_service_store_request** | [**GPUV1ExposedServiceStoreRequest**](GPUV1ExposedServiceStoreRequest.md)| | |
| 67 | + |
| 68 | +### Return type |
| 69 | + |
| 70 | +[**CommonSuccessEmptyResource**](CommonSuccessEmptyResource.md) |
| 71 | + |
| 72 | +### Authorization |
| 73 | + |
| 74 | +[apiToken](../README.md#apiToken) |
| 75 | + |
| 76 | +### HTTP request headers |
| 77 | + |
| 78 | + - **Content-Type**: application/json |
| 79 | + - **Accept**: application/json |
| 80 | + |
| 81 | +### HTTP response details |
| 82 | + |
| 83 | +| Status code | Description | Response headers | |
| 84 | +|-------------|-------------|------------------| |
| 85 | +**200** | Success empty response | - | |
| 86 | +**422** | Validation error response | - | |
| 87 | +**401** | Unauthenticated response | - | |
| 88 | +**500** | Error response | - | |
| 89 | + |
| 90 | +[[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) |
| 91 | + |
| 92 | +# **delete_exposed_service_v1** |
| 93 | +> CommonSuccessEmptyResource delete_exposed_service_v1(instance_id, exposed_service_id) |
| 94 | +
|
| 95 | +Delete exposed service |
| 96 | + |
| 97 | +Delete a specified exposed service of a GPU instance. |
| 98 | + |
| 99 | +The service is removed asynchronously: a successful request returns immediately and the service |
| 100 | +stops being reachable from the internet shortly after. |
| 101 | + |
| 102 | +Use this endpoint to close public access to a service on your GPU instance. |
| 103 | + |
| 104 | +### Example |
| 105 | + |
| 106 | +* Bearer Authentication (apiToken): |
| 107 | + |
| 108 | +```python |
| 109 | +import hostinger_api |
| 110 | +from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource |
| 111 | +from hostinger_api.rest import ApiException |
| 112 | +from pprint import pprint |
| 113 | + |
| 114 | + |
| 115 | +# Configure Bearer authorization: apiToken |
| 116 | +configuration = hostinger_api.Configuration( |
| 117 | + access_token = os.environ["BEARER_TOKEN"] |
| 118 | +) |
| 119 | + |
| 120 | +# Enter a context with an instance of the API client |
| 121 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 122 | + # Create an instance of the API class |
| 123 | + api_instance = hostinger_api.GPUExposedServicesApi(api_client) |
| 124 | + instance_id = 6325 # int | GPU instance ID |
| 125 | + exposed_service_id = 3621 # int | Exposed service ID |
| 126 | + |
| 127 | + try: |
| 128 | + # Delete exposed service |
| 129 | + api_response = api_instance.delete_exposed_service_v1(instance_id, exposed_service_id) |
| 130 | + print("The response of GPUExposedServicesApi->delete_exposed_service_v1:\n") |
| 131 | + pprint(api_response) |
| 132 | + except Exception as e: |
| 133 | + print("Exception when calling GPUExposedServicesApi->delete_exposed_service_v1: %s\n" % e) |
| 134 | +``` |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +### Parameters |
| 139 | + |
| 140 | + |
| 141 | +Name | Type | Description | Notes |
| 142 | +------------- | ------------- | ------------- | ------------- |
| 143 | + **instance_id** | **int**| GPU instance ID | |
| 144 | + **exposed_service_id** | **int**| Exposed service ID | |
| 145 | + |
| 146 | +### Return type |
| 147 | + |
| 148 | +[**CommonSuccessEmptyResource**](CommonSuccessEmptyResource.md) |
| 149 | + |
| 150 | +### Authorization |
| 151 | + |
| 152 | +[apiToken](../README.md#apiToken) |
| 153 | + |
| 154 | +### HTTP request headers |
| 155 | + |
| 156 | + - **Content-Type**: Not defined |
| 157 | + - **Accept**: application/json |
| 158 | + |
| 159 | +### HTTP response details |
| 160 | + |
| 161 | +| Status code | Description | Response headers | |
| 162 | +|-------------|-------------|------------------| |
| 163 | +**200** | Success empty response | - | |
| 164 | +**401** | Unauthenticated response | - | |
| 165 | +**500** | Error response | - | |
| 166 | + |
| 167 | +[[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) |
| 168 | + |
| 169 | +# **get_exposed_services_v1** |
| 170 | +> List[GPUV1ExposedServiceExposedServiceResource] get_exposed_services_v1(instance_id) |
| 171 | +
|
| 172 | +Get exposed services |
| 173 | + |
| 174 | +Retrieve the services exposed on a specified GPU instance. |
| 175 | + |
| 176 | +A newly created service is listed once it gets its public hostname and external port. |
| 177 | + |
| 178 | +Use this endpoint to find the public address of services running on your GPU instance. |
| 179 | + |
| 180 | +### Example |
| 181 | + |
| 182 | +* Bearer Authentication (apiToken): |
| 183 | + |
| 184 | +```python |
| 185 | +import hostinger_api |
| 186 | +from hostinger_api.models.gpuv1_exposed_service_exposed_service_resource import GPUV1ExposedServiceExposedServiceResource |
| 187 | +from hostinger_api.rest import ApiException |
| 188 | +from pprint import pprint |
| 189 | + |
| 190 | + |
| 191 | +# Configure Bearer authorization: apiToken |
| 192 | +configuration = hostinger_api.Configuration( |
| 193 | + access_token = os.environ["BEARER_TOKEN"] |
| 194 | +) |
| 195 | + |
| 196 | +# Enter a context with an instance of the API client |
| 197 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 198 | + # Create an instance of the API class |
| 199 | + api_instance = hostinger_api.GPUExposedServicesApi(api_client) |
| 200 | + instance_id = 6325 # int | GPU instance ID |
| 201 | + |
| 202 | + try: |
| 203 | + # Get exposed services |
| 204 | + api_response = api_instance.get_exposed_services_v1(instance_id) |
| 205 | + print("The response of GPUExposedServicesApi->get_exposed_services_v1:\n") |
| 206 | + pprint(api_response) |
| 207 | + except Exception as e: |
| 208 | + print("Exception when calling GPUExposedServicesApi->get_exposed_services_v1: %s\n" % e) |
| 209 | +``` |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | +### Parameters |
| 214 | + |
| 215 | + |
| 216 | +Name | Type | Description | Notes |
| 217 | +------------- | ------------- | ------------- | ------------- |
| 218 | + **instance_id** | **int**| GPU instance ID | |
| 219 | + |
| 220 | +### Return type |
| 221 | + |
| 222 | +[**List[GPUV1ExposedServiceExposedServiceResource]**](GPUV1ExposedServiceExposedServiceResource.md) |
| 223 | + |
| 224 | +### Authorization |
| 225 | + |
| 226 | +[apiToken](../README.md#apiToken) |
| 227 | + |
| 228 | +### HTTP request headers |
| 229 | + |
| 230 | + - **Content-Type**: Not defined |
| 231 | + - **Accept**: application/json |
| 232 | + |
| 233 | +### HTTP response details |
| 234 | + |
| 235 | +| Status code | Description | Response headers | |
| 236 | +|-------------|-------------|------------------| |
| 237 | +**200** | Success response | - | |
| 238 | +**401** | Unauthenticated response | - | |
| 239 | +**500** | Error response | - | |
| 240 | + |
| 241 | +[[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) |
| 242 | + |
0 commit comments