fix(core): update
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiclient.xyz/hetznercloud',
|
||||
version: '1.0.11',
|
||||
version: '1.0.12',
|
||||
description: 'an unofficial api client for the hetzner cloud api'
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ export class HetznerAccount {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
},
|
||||
requestBody: payloadArg,
|
||||
keepAlive: false,
|
||||
});
|
||||
console.log(response.statusCode);
|
||||
console.log(response.body);
|
||||
|
||||
0
ts/classes.firewall.ts
Normal file
0
ts/classes.firewall.ts
Normal file
@@ -8,7 +8,8 @@ export class HetznerServer {
|
||||
hetznerAccountRefArg: HetznerAccount,
|
||||
optionsArg: {
|
||||
name: string;
|
||||
location: 'nbg1';
|
||||
type: types.THetznerCloudServerName;
|
||||
location: types.THetznerCloudLocationName;
|
||||
labels: {[key: string]: string},
|
||||
}
|
||||
) {
|
||||
@@ -18,7 +19,7 @@ export class HetznerServer {
|
||||
const createServerPayload: types.TServerCreateRequestBody = {
|
||||
name: optionsArg.name,
|
||||
image: 'ubuntu-22.04',
|
||||
server_type: 'cx11',
|
||||
server_type: optionsArg.type,
|
||||
start_after_create: true,
|
||||
labels: optionsArg.labels || {} as any,
|
||||
location: optionsArg.location,
|
||||
|
||||
30
ts/types.ts
30
ts/types.ts
@@ -10,3 +10,33 @@ export type TServersGetResponseBody = plugins.hetznerOpenapi.paths['/servers']['
|
||||
export type TServerCreateRequestBody = plugins.hetznerOpenapi.paths['/servers']['post']['requestBody']['content']['application/json'];
|
||||
export type TServerCreateResponseBody = plugins.hetznerOpenapi.paths['/servers']['post']['responses']['201']['content']['application/json'];
|
||||
|
||||
// server types
|
||||
export type THetznerCloudServerName =
|
||||
| 'cx11'
|
||||
| 'cx21'
|
||||
| 'cx31'
|
||||
| 'cx41'
|
||||
| 'cx51'
|
||||
| 'ccx11'
|
||||
| 'ccx21'
|
||||
| 'ccx31'
|
||||
| 'ccx41'
|
||||
| 'ccx51'
|
||||
| 'ccx13'
|
||||
| 'ccx23'
|
||||
| 'ccx33'
|
||||
| 'ccx43'
|
||||
| 'ccx53'
|
||||
| 'ccx63'
|
||||
| 'cpx11'
|
||||
| 'cpx21'
|
||||
| 'cpx31'
|
||||
| 'cpx41'
|
||||
| 'cpx51'
|
||||
| 'cpx61'
|
||||
| 'cpx70'
|
||||
| 'cpx71'
|
||||
| 'cpx90';
|
||||
|
||||
// location types
|
||||
export type THetznerCloudLocationName = 'fsn1' | 'nbg1' | 'hel1' | 'ash' | 'hil';
|
||||
Reference in New Issue
Block a user