hostinger-api-sdk 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api.ts +380 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +234 -1
- package/dist/api.js +287 -14
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +2 -2
- package/dist/esm/api.d.ts +234 -1
- package/dist/esm/api.js +270 -1
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/base.js +1 -1
- package/dist/esm/common.d.ts +1 -1
- package/dist/esm/common.js +1 -1
- package/dist/esm/configuration.d.ts +1 -1
- package/dist/esm/configuration.js +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/GPUExposedServicesApi.md +177 -0
- package/docs/GPUV1ExposedServiceExposedServiceResource.md +32 -0
- package/docs/GPUV1ExposedServiceStoreRequest.md +26 -0
- package/index.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# GPUExposedServicesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://developers.hostinger.com*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**createExposedServiceV1**](#createexposedservicev1) | **POST** /api/gpu/v1/instances/{instanceId}/exposed-services | Create exposed service|
|
|
8
|
+
|[**deleteExposedServiceV1**](#deleteexposedservicev1) | **DELETE** /api/gpu/v1/instances/{instanceId}/exposed-services/{exposedServiceId} | Delete exposed service|
|
|
9
|
+
|[**getExposedServicesV1**](#getexposedservicesv1) | **GET** /api/gpu/v1/instances/{instanceId}/exposed-services | Get exposed services|
|
|
10
|
+
|
|
11
|
+
# **createExposedServiceV1**
|
|
12
|
+
> CommonSuccessEmptyResource createExposedServiceV1(gPUV1ExposedServiceStoreRequest)
|
|
13
|
+
|
|
14
|
+
Expose a service running on a specified GPU instance to the internet. The service is exposed asynchronously: a successful request returns immediately, and the service appears in the exposed services list once it gets its public hostname and external port. Fails when the instance already has the maximum of 4 exposed services. Use this endpoint to make an application on your GPU instance publicly reachable.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import {
|
|
20
|
+
GPUExposedServicesApi,
|
|
21
|
+
Configuration,
|
|
22
|
+
GPUV1ExposedServiceStoreRequest
|
|
23
|
+
} from '@hostinger/sdk';
|
|
24
|
+
|
|
25
|
+
const configuration = new Configuration();
|
|
26
|
+
const apiInstance = new GPUExposedServicesApi(configuration);
|
|
27
|
+
|
|
28
|
+
let instanceId: number; //GPU instance ID (default to undefined)
|
|
29
|
+
let gPUV1ExposedServiceStoreRequest: GPUV1ExposedServiceStoreRequest; //
|
|
30
|
+
|
|
31
|
+
const { status, data } = await apiInstance.createExposedServiceV1(
|
|
32
|
+
instanceId,
|
|
33
|
+
gPUV1ExposedServiceStoreRequest
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
|Name | Type | Description | Notes|
|
|
40
|
+
|------------- | ------------- | ------------- | -------------|
|
|
41
|
+
| **gPUV1ExposedServiceStoreRequest** | **GPUV1ExposedServiceStoreRequest**| | |
|
|
42
|
+
| **instanceId** | [**number**] | GPU instance ID | defaults to undefined|
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Return type
|
|
46
|
+
|
|
47
|
+
**CommonSuccessEmptyResource**
|
|
48
|
+
|
|
49
|
+
### Authorization
|
|
50
|
+
|
|
51
|
+
[apiToken](../README.md#apiToken)
|
|
52
|
+
|
|
53
|
+
### HTTP request headers
|
|
54
|
+
|
|
55
|
+
- **Content-Type**: application/json
|
|
56
|
+
- **Accept**: application/json
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### HTTP response details
|
|
60
|
+
| Status code | Description | Response headers |
|
|
61
|
+
|-------------|-------------|------------------|
|
|
62
|
+
|**200** | Success empty response | - |
|
|
63
|
+
|**422** | Validation error response | - |
|
|
64
|
+
|**401** | Unauthenticated response | - |
|
|
65
|
+
|**500** | Error response | - |
|
|
66
|
+
|
|
67
|
+
[[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)
|
|
68
|
+
|
|
69
|
+
# **deleteExposedServiceV1**
|
|
70
|
+
> CommonSuccessEmptyResource deleteExposedServiceV1()
|
|
71
|
+
|
|
72
|
+
Delete a specified exposed service of a GPU instance. The service is removed asynchronously: a successful request returns immediately and the service stops being reachable from the internet shortly after. Use this endpoint to close public access to a service on your GPU instance.
|
|
73
|
+
|
|
74
|
+
### Example
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import {
|
|
78
|
+
GPUExposedServicesApi,
|
|
79
|
+
Configuration
|
|
80
|
+
} from '@hostinger/sdk';
|
|
81
|
+
|
|
82
|
+
const configuration = new Configuration();
|
|
83
|
+
const apiInstance = new GPUExposedServicesApi(configuration);
|
|
84
|
+
|
|
85
|
+
let instanceId: number; //GPU instance ID (default to undefined)
|
|
86
|
+
let exposedServiceId: number; //Exposed service ID (default to undefined)
|
|
87
|
+
|
|
88
|
+
const { status, data } = await apiInstance.deleteExposedServiceV1(
|
|
89
|
+
instanceId,
|
|
90
|
+
exposedServiceId
|
|
91
|
+
);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Parameters
|
|
95
|
+
|
|
96
|
+
|Name | Type | Description | Notes|
|
|
97
|
+
|------------- | ------------- | ------------- | -------------|
|
|
98
|
+
| **instanceId** | [**number**] | GPU instance ID | defaults to undefined|
|
|
99
|
+
| **exposedServiceId** | [**number**] | Exposed service ID | defaults to undefined|
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Return type
|
|
103
|
+
|
|
104
|
+
**CommonSuccessEmptyResource**
|
|
105
|
+
|
|
106
|
+
### Authorization
|
|
107
|
+
|
|
108
|
+
[apiToken](../README.md#apiToken)
|
|
109
|
+
|
|
110
|
+
### HTTP request headers
|
|
111
|
+
|
|
112
|
+
- **Content-Type**: Not defined
|
|
113
|
+
- **Accept**: application/json
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### HTTP response details
|
|
117
|
+
| Status code | Description | Response headers |
|
|
118
|
+
|-------------|-------------|------------------|
|
|
119
|
+
|**200** | Success empty response | - |
|
|
120
|
+
|**401** | Unauthenticated response | - |
|
|
121
|
+
|**500** | Error response | - |
|
|
122
|
+
|
|
123
|
+
[[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)
|
|
124
|
+
|
|
125
|
+
# **getExposedServicesV1**
|
|
126
|
+
> Array<GPUV1ExposedServiceExposedServiceResource> getExposedServicesV1()
|
|
127
|
+
|
|
128
|
+
Retrieve the services exposed on a specified GPU instance. A newly created service is listed once it gets its public hostname and external port. Use this endpoint to find the public address of services running on your GPU instance.
|
|
129
|
+
|
|
130
|
+
### Example
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import {
|
|
134
|
+
GPUExposedServicesApi,
|
|
135
|
+
Configuration
|
|
136
|
+
} from '@hostinger/sdk';
|
|
137
|
+
|
|
138
|
+
const configuration = new Configuration();
|
|
139
|
+
const apiInstance = new GPUExposedServicesApi(configuration);
|
|
140
|
+
|
|
141
|
+
let instanceId: number; //GPU instance ID (default to undefined)
|
|
142
|
+
|
|
143
|
+
const { status, data } = await apiInstance.getExposedServicesV1(
|
|
144
|
+
instanceId
|
|
145
|
+
);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Parameters
|
|
149
|
+
|
|
150
|
+
|Name | Type | Description | Notes|
|
|
151
|
+
|------------- | ------------- | ------------- | -------------|
|
|
152
|
+
| **instanceId** | [**number**] | GPU instance ID | defaults to undefined|
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Return type
|
|
156
|
+
|
|
157
|
+
**Array<GPUV1ExposedServiceExposedServiceResource>**
|
|
158
|
+
|
|
159
|
+
### Authorization
|
|
160
|
+
|
|
161
|
+
[apiToken](../README.md#apiToken)
|
|
162
|
+
|
|
163
|
+
### HTTP request headers
|
|
164
|
+
|
|
165
|
+
- **Content-Type**: Not defined
|
|
166
|
+
- **Accept**: application/json
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
### HTTP response details
|
|
170
|
+
| Status code | Description | Response headers |
|
|
171
|
+
|-------------|-------------|------------------|
|
|
172
|
+
|**200** | Success response | - |
|
|
173
|
+
|**401** | Unauthenticated response | - |
|
|
174
|
+
|**500** | Error response | - |
|
|
175
|
+
|
|
176
|
+
[[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)
|
|
177
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# GPUV1ExposedServiceExposedServiceResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**id** | **number** | Exposed service ID | [optional] [default to undefined]
|
|
9
|
+
**name** | **string** | | [optional] [default to undefined]
|
|
10
|
+
**hostname** | **string** | Public hostname or IP address of the service | [optional] [default to undefined]
|
|
11
|
+
**internal_port** | **number** | Port the service listens on inside the instance | [optional] [default to undefined]
|
|
12
|
+
**external_port** | **number** | Public port the service is reachable on | [optional] [default to undefined]
|
|
13
|
+
**protocol** | **string** | | [optional] [default to undefined]
|
|
14
|
+
**type** | **string** | | [optional] [default to undefined]
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { GPUV1ExposedServiceExposedServiceResource } from '@hostinger/sdk';
|
|
20
|
+
|
|
21
|
+
const instance: GPUV1ExposedServiceExposedServiceResource = {
|
|
22
|
+
id,
|
|
23
|
+
name,
|
|
24
|
+
hostname,
|
|
25
|
+
internal_port,
|
|
26
|
+
external_port,
|
|
27
|
+
protocol,
|
|
28
|
+
type,
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# GPUV1ExposedServiceStoreRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**name** | **string** | Service name, unique within the instance | [default to undefined]
|
|
9
|
+
**internal_port** | **number** | Port the service listens on inside the instance, unique within the instance | [default to undefined]
|
|
10
|
+
**protocol** | **string** | | [default to undefined]
|
|
11
|
+
**type** | **string** | | [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { GPUV1ExposedServiceStoreRequest } from '@hostinger/sdk';
|
|
17
|
+
|
|
18
|
+
const instance: GPUV1ExposedServiceStoreRequest = {
|
|
19
|
+
name,
|
|
20
|
+
internal_port,
|
|
21
|
+
protocol,
|
|
22
|
+
type,
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.
|
|
6
|
+
* API Version: 2.16.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|